From 5b69146a3c97055555382b7d07d2f763512bf83b Mon Sep 17 00:00:00 2001 From: JohannesSetiawan Date: Thu, 22 Feb 2024 17:08:10 +0700 Subject: [PATCH] Create new workflow for Build and Test for all branch without SonarQube to accomodate TDD test phase --- .../workflows/django-build-test-allbranch.yml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/django-build-test-allbranch.yml diff --git a/.github/workflows/django-build-test-allbranch.yml b/.github/workflows/django-build-test-allbranch.yml new file mode 100644 index 0000000..5f60596 --- /dev/null +++ b/.github/workflows/django-build-test-allbranch.yml @@ -0,0 +1,39 @@ +name: Build and Test + +on: + push: + branches: + - '*' + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: [3.11] + + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Set Up Environment Variables + run: | + echo "DB_HOST=${{ secrets.DB_HOST }}" >> .env + echo "DJANGO_SECRET_KEY=${{ secrets.DJANGO_SECRET_KEY }}" >> .env + echo "DB_NAME=${{ secrets.DB_NAME }}" >> .env + echo "DB_USER=${{ secrets.DB_USER }}" >> .env + echo "DB_PASS=${{ secrets.DB_PASS }}" >> .env + cp .env revelio/.env + + - name: Run Tests + run: | + python manage.py test \ No newline at end of file