style: format code with Black and Gofumpt #87
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| run-tests: | |
| runs-on: [ubuntu-latest] | |
| env: | |
| DEEPSOURCE_DSN_DEV: ${{ secrets.DEEPSOURCE_DSN_DEV }} | |
| DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }} | |
| DEEPSOURCE_DSN_ENTERPRISE_DEV: ${{ secrets.DEEPSOURCE_DSN_ENTERPRISE_DEV }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 1 | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Set up python3.9 | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: '3.9' | |
| - name: Run tests | |
| run: | | |
| pip install pytest-cov django | |
| coverage run -m pytest tests/test_code.py | |
| coverage xml -o coverage.xml | |
| coverage erase | |
| coverage run -m pytest tests/test_code2.py | |
| coverage xml -o coverage2.xml | |
| coverage erase | |
| # - name: Report test coverage to DeepSource dev (python) | |
| # run: | | |
| # curl https://deepsource.io/cli | sh | |
| # export DEEPSOURCE_DSN=$DEEPSOURCE_DSN_DEV | |
| # # create python artifact | |
| # ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml | |
| # # create another python artifact | |
| # ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage2.xml | |
| # # existing python artifact with same file so update only | |
| # ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml | |
| - name: Report test coverage to DeepSource cloud (go) | |
| if: github.event_name != 'pull_request' | |
| run: | | |
| curl https://deepsource.io/cli | sh | |
| export DEEPSOURCE_DSN=$DEEPSOURCE_DSN | |
| # create go artifact | |
| ./bin/deepsource report --analyzer test-coverage --key go --value-file ./go_coverage.out | |
| - name: Report test coverage to DeepSource cloud (python) | |
| run: | | |
| curl https://deepsource.io/cli | sh | |
| export DEEPSOURCE_DSN=$DEEPSOURCE_DSN | |
| # create python artifact | |
| ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml | |
| # create another python artifact | |
| ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage2.xml | |
| # existing python artifact with same file so update only | |
| ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml | |
| # - name: Report test coverage to DeepSource dev (go) | |
| # if: github.event_name != 'pull_request' | |
| # run: | | |
| # curl https://deepsource.io/cli | sh | |
| # export DEEPSOURCE_DSN=$DEEPSOURCE_DSN_DEV | |
| # # create go artifact | |
| # ./bin/deepsource report --analyzer test-coverage --key go --value-file ./go_coverage.out | |
| # - name: Report test coverage to DeepSource enterprise-dev (python) | |
| # run: | | |
| # curl https://deepsource.io/cli | sh | |
| # export DEEPSOURCE_DSN=$DEEPSOURCE_DSN_ENTERPRISE_DEV | |
| # # create python artifact | |
| # ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml | |
| # # create another python artifact | |
| # ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage2.xml | |
| # # existing python artifact with same file so update only | |
| # ./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml | |
| # - name: Report test coverage to DeepSource enterprise-dev (go) | |
| # if: github.event_name != 'pull_request' | |
| # run: | | |
| # curl https://deepsource.io/cli | sh | |
| # export DEEPSOURCE_DSN=$DEEPSOURCE_DSN_ENTERPRISE_DEV | |
| # # create go artifact | |
| # ./bin/deepsource report --analyzer test-coverage --key go --value-file ./go_coverage.out | |