diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 3589447..6b84a84 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -11,6 +11,11 @@ jobs: fail-fast: false matrix: node: [18, 20, 21] + env: + CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} + DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} name: Node ${{ matrix.node }} steps: @@ -29,6 +34,13 @@ jobs: - name: Copy Test Config run: cp ./data/config.testing.js ./data/config.js + - name: Code Climate (Before) + if: ${{ github.event_name != 'pull_request' && env.CC_TEST_REPORTER_ID != '' && matrix.node == 20 }} + run: | + curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./codeclimate-test-reporter + chmod +x codeclimate-test-reporter + ./codeclimate-test-reporter before-build + - name: Verify Cypress run: cypress verify env: @@ -39,18 +51,23 @@ jobs: env: CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - - name: Code Climate - if: ${{ ! cancelled() && github.event_name != 'pull_request' && env.CC_TEST_REPORTER_ID != '' && matrix.node == 20 }} + - name: Code Climate (After) + if: ${{ github.event_name != 'pull_request' && env.CC_TEST_REPORTER_ID != '' && matrix.node == 20 }} run: | - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./codeclimate-test-reporter - chmod +x codeclimate-test-reporter - ./codeclimate-test-reporter before-build ./codeclimate-test-reporter after-build -t lcov --exit-code $? - env: - CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} - - name: Codacy - if: ${{ ! cancelled() && github.event_name != 'pull_request' && env.CODACY_PROJECT_TOKEN != '' && matrix.node == 20 }} - run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r ./coverage/lcov.info - env: - CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} + - name: Codecov + if: ${{ github.event_name != 'pull_request' && env.CODECOV_TOKEN != '' && matrix.node == 20 }} + run: | + curl -Os https://uploader.codecov.io/latest/linux/codecov + chmod +x codecov + ./codecov -t ${CODECOV_TOKEN} + + - name: DeepSource + if: ${{ github.event_name != 'pull_request' && env.DEEPSOURCE_DSN != '' && matrix.node == 20 }} + run: | + # Install deepsource CLI + curl https://deepsource.io/cli | sh + + # From the root directory, run the report coverage command + ./bin/deepsource report --analyzer test-coverage --key javascript --value-file ./coverage/lcov.info diff --git a/README.md b/README.md index 84817c4..7eee86f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # General Licence Manager [Made with Bulma](https://bulma.io) -[![Codacy grade](https://img.shields.io/codacy/grade/97f530e50c2f416eb1eb5be9e4ef846f)](https://app.codacy.com/gh/cityssm/general-licence-manager/dashboard) +[![DeepSource](https://app.deepsource.com/gh/cityssm/general-licence-manager.svg/?label=active+issues&show_trend=true&token=ORSrQ921SKObd83e2GbLdPu4)](https://app.deepsource.com/gh/cityssm/general-licence-manager/) [![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/cityssm/general-licence-manager)](https://codeclimate.com/github/cityssm/general-licence-manager) [![Code Climate coverage](https://img.shields.io/codeclimate/coverage/cityssm/general-licence-manager)](https://codeclimate.com/github/cityssm/general-licence-manager) [![Coverage Testing](https://github.com/cityssm/general-licence-manager/actions/workflows/coverage.yml/badge.svg)](https://github.com/cityssm/general-licence-manager/actions/workflows/coverage.yml)