From ad19a8bac6ad0411e3c2c2530b0ca6ee1541d072 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 20 Aug 2024 22:51:05 +0100 Subject: chore: rm workflow file from development --- .github/workflows/deploy.yml | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 .github/workflows/deploy.yml (limited to '.github') diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index 09b8490..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: deploy-terraform - -on: - pull_request: - branches: - - main - push: - branches: - - main - - -jobs: - deploy-terraform: - if: github.ref == 'refs/heads/main' - name: Deploy Terraform - runs-on: ubuntu-latest - #needs: run-checks (must ref on-commit.yml file) - environment: production - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - - name: Install Terraform - uses: hashicorp/setup-terraform@v3 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - aws-region: ${{ secrets.AWS_REGION }} - - - name: Terraform Init - working-directory: terraform - run: terraform init - - - name: Terraform Plan - working-directory: terraform - run: terraform plan - - - name: Terraform Apply - working-directory: terraform - run: terraform apply --auto-approve -- cgit v1.2.3 From 9511ac7958efcadad6cd1323027674988042bee9 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 20 Aug 2024 23:09:46 +0100 Subject: ci: create dev-tests.yml --- .github/workflows/dev-tests.yml | 49 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/dev-tests.yml (limited to '.github') diff --git a/.github/workflows/dev-tests.yml b/.github/workflows/dev-tests.yml new file mode 100644 index 0000000..9f71515 --- /dev/null +++ b/.github/workflows/dev-tests.yml @@ -0,0 +1,49 @@ +name: dev-tests + +on: + pull_request: + branches: + - development + push: + branches: + - development + +jobs: + validate-and-test: + name: Validate Terraform and Run Tests + runs-on: ubuntu-latest + environment: testing + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Install Terraform + uses: hashicorp/setup-terraform@v3 + + - name: Terraform Init + working-directory: terraform + run: terraform init -backend=false + + - name: Terraform Validate + working-directory: terraform + run: terraform validate + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Install Python dependencies + run: | + python -m pip install --upgrade pip + pip install pytest pytest-testdox + pip install -r requirements.txt + + - name: Run pytest + run: pytest tests/ -vvrP --testdox + continue-on-error: true + id: pytest + + - name: Check on failures + if: steps.pytest.outcome == 'failure' + run: exit 1 -- cgit v1.2.3 From 0cf8f2c238c2f86ee6c97ed7b95e78c67d1782b5 Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 20 Aug 2024 23:13:34 +0100 Subject: ci: remove environment for dev-tests.yml --- .github/workflows/dev-tests.yml | 1 - 1 file changed, 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/dev-tests.yml b/.github/workflows/dev-tests.yml index 9f71515..d66f1c6 100644 --- a/.github/workflows/dev-tests.yml +++ b/.github/workflows/dev-tests.yml @@ -12,7 +12,6 @@ jobs: validate-and-test: name: Validate Terraform and Run Tests runs-on: ubuntu-latest - environment: testing steps: - name: Checkout Repo uses: actions/checkout@v4 -- cgit v1.2.3 From 77fa5b0922c214ae0b16d5582aa20af9c75e2f31 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 21 Aug 2024 16:46:09 +0100 Subject: Update dev-tests.yml --- .github/workflows/dev-tests.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.github') diff --git a/.github/workflows/dev-tests.yml b/.github/workflows/dev-tests.yml index d66f1c6..b64032e 100644 --- a/.github/workflows/dev-tests.yml +++ b/.github/workflows/dev-tests.yml @@ -10,6 +10,7 @@ on: jobs: validate-and-test: + environment: testing name: Validate Terraform and Run Tests runs-on: ubuntu-latest steps: -- cgit v1.2.3 From 93a56e57daee737ae87be8f3174ad69ca16f7392 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 21 Aug 2024 16:49:30 +0100 Subject: ci: update dev-tests.yml --- .github/workflows/dev-tests.yml | 3 +++ 1 file changed, 3 insertions(+) (limited to '.github') diff --git a/.github/workflows/dev-tests.yml b/.github/workflows/dev-tests.yml index b64032e..443e03b 100644 --- a/.github/workflows/dev-tests.yml +++ b/.github/workflows/dev-tests.yml @@ -8,6 +8,9 @@ on: branches: - development +env: + PYTHONPATH: ${{ github.workspace }} + jobs: validate-and-test: environment: testing -- cgit v1.2.3 From 221ce41774082e6a3ffbbb36c702a1a60eb59bd4 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 22 Aug 2024 12:20:51 +0100 Subject: ci: simplify pytest output & add coverage report --- .github/workflows/dev-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/dev-tests.yml b/.github/workflows/dev-tests.yml index 443e03b..ec169b4 100644 --- a/.github/workflows/dev-tests.yml +++ b/.github/workflows/dev-tests.yml @@ -39,11 +39,11 @@ jobs: - name: Install Python dependencies run: | python -m pip install --upgrade pip - pip install pytest pytest-testdox + pip install pytest pytest-testdox pytest-cov pip install -r requirements.txt - name: Run pytest - run: pytest tests/ -vvrP --testdox + run: pytest -v --cov=src --cov-report=xml --cov-report=term-missing continue-on-error: true id: pytest -- cgit v1.2.3 From 46671be246a19bc9d157a00e5ba00e0132ce27cd Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 22 Aug 2024 12:38:00 +0100 Subject: ci: upload coverage report as artifact --- .github/workflows/dev-tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) (limited to '.github') diff --git a/.github/workflows/dev-tests.yml b/.github/workflows/dev-tests.yml index ec169b4..e183f36 100644 --- a/.github/workflows/dev-tests.yml +++ b/.github/workflows/dev-tests.yml @@ -50,3 +50,10 @@ jobs: - name: Check on failures if: steps.pytest.outcome == 'failure' run: exit 1 + + - name: Upload Coverage Report' + uses: actions/upload-artifact@v4 + with: + name: cov-report + path: coverage.xml + retention-days: 7 -- cgit v1.2.3