From def2e275718b8ed1615ac72b017b20d5d97fde1e Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Wed, 8 May 2024 11:39:56 -0600 Subject: [PATCH] ci: upload coverage on release --- .github/workflows/push.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 4dd1b35..669d6b7 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -31,3 +31,36 @@ jobs: github-app-key: ${{ secrets.UGRC_RELEASE_BOT_APP_KEY }} github-app-name: ${{ secrets.UGRC_RELEASE_BOT_NAME }} github-app-email: ${{ secrets.UGRC_RELEASE_BOT_EMAIL }} + + upload-coverage: + name: Upload coverage + runs-on: ubuntu-latest + needs: release-please + if: github.ref == 'refs/heads/main' && needs.release-please.outputs.release_created + + steps: + - name: โฌ‡๏ธ Set up code + uses: actions/checkout@v4 + with: + show-progress: false + + - name: ๐Ÿ Set up Python + uses: actions/setup-python@v5 + with: + cache: pip + cache-dependency-path: setup.py + + - name: ๐Ÿ— Install module + run: pip install .[tests] + + - name: โš™๏ธ Add config file + run: cp config.sample.json config.json + + - name: ๐Ÿงช Run tests + run: pytest + + - name: โฌ†๏ธ Upload coverage to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./cov.xml