From 5001ef53f9980321ce0aa92e104ee7a76f2f8051 Mon Sep 17 00:00:00 2001 From: wling <90316914+wling-art@users.noreply.github.com> Date: Wed, 10 Jan 2024 05:45:35 +0800 Subject: [PATCH 1/2] Create main.yml --- .github/workflows/main.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..2cf9341 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,15 @@ +on: + push: + branches: + - main +jobs: + report: + name: deploy to staging + runs-on: ubuntu-18.04 + steps: + - name: Report test coverage to DeepSource + uses: deepsourcelabs/test-coverage-action@master + with: + key: python + coverage-file: coverage.xml + dsn: ${{ secrets.DEEPSOURCE_DSN }} From 7245ae241382d63585fea7f12760b03b88c18152 Mon Sep 17 00:00:00 2001 From: wling <90316914+wling-art@users.noreply.github.com> Date: Wed, 10 Jan 2024 05:50:04 +0800 Subject: [PATCH 2/2] Update main.yml --- .github/workflows/main.yml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2cf9341..09107cd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,15 +1,18 @@ -on: - push: - branches: - - main +name: Report Test Coverage + +on: [pull_request, push] + jobs: - report: - name: deploy to staging - runs-on: ubuntu-18.04 - steps: - - name: Report test coverage to DeepSource - uses: deepsourcelabs/test-coverage-action@master - with: - key: python - coverage-file: coverage.xml - dsn: ${{ secrets.DEEPSOURCE_DSN }} + report_coverage: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Report test coverage to DeepSource + uses: deepsourcelabs/test-coverage-action@master + with: + key: python + coverage-file: coverage.xml + dsn: ${{ secrets.DEEPSOURCE_DSN }} + fail-ci-on-error: true # Optional: Set to true if you want the CI build to fail on error