From 02008e61dbd6e404c245102987c50e39d3e5ba63 Mon Sep 17 00:00:00 2001 From: indivar Date: Thu, 15 Jun 2023 22:27:28 +0530 Subject: [PATCH 1/4] chore: added venv in .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 5d31a046..c1b79f2b 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ var/ *.egg-info/ .installed.cfg *.egg +venv/ # PyInstaller # Usually these files are written by a python script from a template From 7e329913059aea6c119150a171acc3fdcc387db7 Mon Sep 17 00:00:00 2001 From: indivar Date: Thu, 15 Jun 2023 22:33:40 +0530 Subject: [PATCH 2/4] add(751): add github actions to execute tests - created workflow directory and test.yml workflow - added a job that executes existing compose.test.yml file to run tests - job will be triggered when a PR is raised to master or push happens to master ( post merge also will trigger a job ) - added concurrency check so that old job can be cancelled if a new push happens --- .github/workflows/ci.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..6c2ddcd7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: CI + +on: + push: + branches: + - master + pull_request: + branches: + - master # Only run when PR is raised for master + +# This ensures for a single PR one job is run in case of multiple runs +concurrency: + group: build-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + # Run Tests + - name: Run Tests + run: docker-compose -f "docker-compose.test.yml" up --build From ff03a49f3815f166943517d7b5a168bf8aa5e31d Mon Sep 17 00:00:00 2001 From: indivar Date: Sat, 24 Jun 2023 22:25:37 +0530 Subject: [PATCH 3/4] add(751): add coverage report --- .github/workflows/ci.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c2ddcd7..6e260b3d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,9 @@ on: branches: - master # Only run when PR is raised for master +permissions: + pull-requests: write # for writting comment for coverage + # This ensures for a single PR one job is run in case of multiple runs concurrency: group: build-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -21,3 +24,22 @@ jobs: # Run Tests - name: Run Tests run: docker-compose -f "docker-compose.test.yml" up --build + # Code Coverage + - name: Code Coverage Report + uses: irongut/CodeCoverageSummary@v1.3.0 + with: + filename: ./temp/testresults/coverage.xml + badge: true + fail_below_min: true + format: markdown + hide_branch_rate: false + hide_complexity: true + indicators: true + output: both + thresholds: '60 80' + - name: Add Coverage PR Comment + uses: marocchino/sticky-pull-request-comment@v2 + if: github.event_name == 'pull_request' + with: + recreate: true + path: code-coverage-results.md From 6ec8681d39db4da891f460cb500a40be197c3de9 Mon Sep 17 00:00:00 2001 From: indivar Date: Tue, 4 Jul 2023 23:15:26 +0530 Subject: [PATCH 4/4] add(751): add publish test result action followed steps specified in below mentioned link to do the setup https://github.com/EnricoMi/publish-unit-test-result-action/blob/v2.8.0/README.md#support-fork-repositories-and-dependabot-branches --- .github/workflows/ci.yml | 17 ++++++++++++++++ .github/workflows/test_reports.yml | 31 ++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 .github/workflows/test_reports.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e260b3d..28c9c0e2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,3 +43,20 @@ jobs: with: recreate: true path: code-coverage-results.md + - name: Upload Test Results + if: always() + uses: actions/upload-artifact@v3 + with: + name: Test Results + path: | + ./temp/testresults/test-results.xml + + event_file: + name: "Event File" + runs-on: ubuntu-latest + steps: + - name: Upload + uses: actions/upload-artifact@v3 + with: + name: Event File + path: ${{ github.event_path }} \ No newline at end of file diff --git a/.github/workflows/test_reports.yml b/.github/workflows/test_reports.yml new file mode 100644 index 00000000..c62bd61a --- /dev/null +++ b/.github/workflows/test_reports.yml @@ -0,0 +1,31 @@ +name: Test Reports + +on: + workflow_run: + workflows: ["CI"] + types: + - completed +permissions: {} + +jobs: + test_reports: + name: Test Reports + runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion != 'skipped' + permissions: + checks: write + pull-requests: write + actions: read + steps: + - name: Download and Extract Artifacts + uses: dawidd6/action-download-artifact@246dbf436b23d7c49e21a7ab8204ca9ecd1fe615 + with: + run_id: ${{ github.event.workflow_run.id }} + path: artifacts + - name: Publish Test Results + uses: EnricoMi/publish-unit-test-result-action@v2 + with: + commit: ${{ github.event.workflow_run.head_sha }} + event_file: artifacts/Event File/event.json + event_name: ${{ github.event.workflow_run.event }} + files: "artifacts/**/*.xml"