diff options
author | Alec Scott <hi@alecbcs.com> | 2024-09-27 18:13:33 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-28 01:13:33 +0000 |
commit | 04fb52aeca7ea67aa8e63fd88fff142b134735e7 (patch) | |
tree | b88d3c61ea29343642826afcef260ba14e9b1f66 /.github/workflows | |
parent | 98854582e3f5a88fbb7cf879295d66399724a2d1 (diff) | |
download | spack-04fb52aeca7ea67aa8e63fd88fff142b134735e7.tar.gz spack-04fb52aeca7ea67aa8e63fd88fff142b134735e7.tar.bz2 spack-04fb52aeca7ea67aa8e63fd88fff142b134735e7.tar.xz spack-04fb52aeca7ea67aa8e63fd88fff142b134735e7.zip |
ci: simplify coverage CI/CD job (#46441)
* ci: simplify coverage CI/CD job
* Fix typo in dependent job
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/ci.yaml | 53 | ||||
-rw-r--r-- | .github/workflows/coverage.yml | 34 | ||||
-rw-r--r-- | .github/workflows/requirements/coverage/requirements.txt | 1 |
3 files changed, 55 insertions, 33 deletions
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f9a8a882ce..5088cd2794 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -15,18 +15,6 @@ concurrency: cancel-in-progress: true jobs: - prechecks: - needs: [ changes ] - uses: ./.github/workflows/valid-style.yml - secrets: inherit - with: - with_coverage: ${{ needs.changes.outputs.core }} - all-prechecks: - needs: [ prechecks ] - runs-on: ubuntu-latest - steps: - - name: Success - run: "true" # Check which files have been updated by the PR changes: runs-on: ubuntu-latest @@ -79,35 +67,34 @@ jobs: needs: [ prechecks, changes ] uses: ./.github/workflows/bootstrap.yml secrets: inherit + unit-tests: if: ${{ github.repository == 'spack/spack' && needs.changes.outputs.core == 'true' }} needs: [ prechecks, changes ] uses: ./.github/workflows/unit_tests.yaml secrets: inherit - upload-coverage: - needs: [ unit-tests, prechecks ] + + prechecks: + needs: [ changes ] + uses: ./.github/workflows/valid-style.yml + secrets: inherit + with: + with_coverage: ${{ needs.changes.outputs.core }} + + all-prechecks: + needs: [ prechecks ] runs-on: ubuntu-latest steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 - with: - fetch-depth: 0 - - name: Download coverage files - uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 - with: - pattern: coverage-* - path: coverage - merge-multiple: true - - run: pip install --upgrade coverage - - run: ls -la coverage - - run: coverage combine -a coverage/.coverage* - - run: coverage xml - - name: "Upload coverage" - uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 - with: - token: ${{ secrets.CODECOV_TOKEN }} - verbose: true + - name: Success + run: "true" + + coverage: + needs: [ unit-tests, prechecks ] + uses: ./.github/workflows/coverage.yml + secrets: inherit + all: - needs: [ upload-coverage, bootstrap ] + needs: [ coverage, bootstrap ] runs-on: ubuntu-latest steps: - name: Success diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000000..3817ee9e5c --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,34 @@ +name: coverage + +on: + workflow_call: + +jobs: + # Upload coverage reports to codecov once as a single bundle + upload: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 + with: + python-version: '3.11' + cache: 'pip' + + - name: Install python dependencies + run: pip install -r .github/workflows/requirements/coverage/requirements.txt + + - name: Download coverage artifact files + uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 + with: + pattern: coverage-* + path: coverage + merge-multiple: true + + - run: ls -la coverage + - run: coverage combine -a coverage/.coverage* + - run: coverage xml + + - name: "Upload coverage report to CodeCov" + uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 + with: + verbose: true diff --git a/.github/workflows/requirements/coverage/requirements.txt b/.github/workflows/requirements/coverage/requirements.txt new file mode 100644 index 0000000000..1bf0f9a76b --- /dev/null +++ b/.github/workflows/requirements/coverage/requirements.txt @@ -0,0 +1 @@ +coverage==7.6.1 |