diff --git a/.gitea/workflows/ci-pipeline.yaml b/.gitea/workflows/ci-pipeline.yaml new file mode 100644 index 0000000..44eece3 --- /dev/null +++ b/.gitea/workflows/ci-pipeline.yaml @@ -0,0 +1,52 @@ +name: Django CI Pipeline + +on: + push: + branches: + - main + - release + - testing-pipeline + +jobs: + test: + + runs-on: ubuntu-22.04 + + env: + SECRET_KEY: "t3st-dummy-s3cr3t-k3y" + STATIC_ROOT: "tmp/static/" + MEDIA_ROOT: "tmp/media/" + + steps: + - uses: actions/checkout@v4 + + - name: Install python3-venv + id: install + run: | + apt-get update + apt-get install python3 python3-venv python3-pip -y + + - name: Check Python version + run: | + python3 --version + echo "Python version: $(python3 --version)" + + - name: Create virtual environment + run: | + python3 -m venv venv + source venv/bin/activate + echo "Virtual environment created successfully" + # https://docs.github.com/en/actions/learn-github-actions/contexts#steps-context + if: steps.install.outcome == 'success' + + - name: Install dependencies + run: | + source venv/bin/activate + pip install --upgrade pip + pip install -r requirements.txt + + - name: Run tests + run: | + source venv/bin/activate + python manage.py test + diff --git a/.gitea/workflows/demo.yaml b/.gitea/workflows/demo.yaml deleted file mode 100644 index 1029150..0000000 --- a/.gitea/workflows/demo.yaml +++ /dev/null @@ -1,19 +0,0 @@ -name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 -on: [push] - -jobs: - Explore-Gitea-Actions: - runs-on: ubuntu-latest - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ gitea.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "🔎 The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - - name: Check out repository code - uses: actions/checkout@v3 - - run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ gitea.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}." diff --git a/trustchain_idhub/settings.py b/trustchain_idhub/settings.py index b9eecc5..15c1e82 100644 --- a/trustchain_idhub/settings.py +++ b/trustchain_idhub/settings.py @@ -33,8 +33,8 @@ SECRET_KEY = config('SECRET_KEY') DEBUG = config('DEBUG', default=False, cast=bool) DEVELOPMENT = config('DEVELOPMENT', default=False, cast=bool) -ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=[], cast=Csv()) -CSRF_TRUSTED_ORIGINS = config('CSRF_TRUSTED_ORIGINS', default=[], cast=Csv()) +ALLOWED_HOSTS = config('ALLOWED_HOSTS', default=[]) +CSRF_TRUSTED_ORIGINS = config('CSRF_TRUSTED_ORIGINS', default=[]) DOMAIN = config("DOMAIN", "http://localhost")