Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable coverage for PRs #17204

Merged
merged 14 commits into from
Nov 8, 2024
11 changes: 8 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ jobs:
test-name: ${{ matrix.test-suite.name || matrix.test-suite.command }} on ${{ matrix.platform }}/${{ matrix.version-set.name }}
test-command: ${{ matrix.test-suite.command }}
is-integration-test: true
enable-coverage: ${{ inputs.enable-coverage }}
enable-coverage: false
test-retries: ${{ inputs.test-retries }}
# require-build: false # TODO, remove ${{ matrix.require-build || false }}

Expand All @@ -419,7 +419,7 @@ jobs:
test-name: ${{ matrix.test-suite.name || matrix.test-suite.command }} on ${{ matrix.platform }}/${{ matrix.version-set.name }}
test-command: ${{ matrix.test-suite.command }}
is-integration-test: true
enable-coverage: ${{ inputs.enable-coverage }}
enable-coverage: false
test-retries: ${{ inputs.test-retries }}
# require-build: false # TODO, remove ${{ matrix.require-build || false }}

Expand Down Expand Up @@ -448,7 +448,7 @@ jobs:
ls -lhR test-results
find test-results -mindepth 1 -name '*.json' -mtime +7 -delete
test-collect-coverage:
needs: [unit-test, integration-test, acceptance-test-macos]
needs: [unit-test, integration-test]
if: ${{ inputs.enable-coverage }}
runs-on: ubuntu-latest
steps:
Expand All @@ -472,6 +472,11 @@ jobs:
pattern: coverage-*
merge-multiple: true
path: coverage
- name: Set codecov PR base
run: |
curl -Os https://cli.codecov.io/latest/linux/codecov
sudo chmod +x codecov
./codecov pr-base-picking --base-sha "$(git merge-base origin/master HEAD)" --pr ${{ github.event.number }} --slug pulumi/pulumi --token ${{ secrets.CODECOV_TOKEN }} --service github
- name: Upload code coverage
uses: codecov/codecov-action@v4
with:
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
- "sdk/.version"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

# The jobs in this workflow are only run on branches. The `on-community-pr.yml` job provides
Expand All @@ -28,7 +28,7 @@ jobs:
permissions:
contents: read
with:
ref: ${{ github.ref }}
ref: ${{ github.head_ref }}
is-snapshot: true
secrets: inherit

Expand Down Expand Up @@ -67,17 +67,13 @@ jobs:
# To sign artifacts.
id-token: write
with:
ref: ${{ github.ref }}
ref: ${{ github.head_ref }}
version: ${{ needs.info.outputs.version }}
lint: true
# codegen tests take quite a while to run.
# Run them only if ci/test is set,
# or if one of the codegen files changed.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this comment outdated now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, good catch! I've updated it now.

test-codegen: >- # No newlines or trailing newline.
${{
contains(github.event.pull_request.labels.*.name, 'ci/test') ||
(needs.inspect.outputs.test-codegen == 'true')
}}
test-codegen: true
test-version-sets: >- # No newlines or trailing newline.
${{
contains(github.event.pull_request.labels.*.name, 'ci/test')
Expand All @@ -91,8 +87,7 @@ jobs:
&& 'macos-latest windows-latest'
|| 'windows-latest'
}}
# We'll only upload coverage artifacts with the periodic-coverage cron workflow.
enable-coverage: false
enable-coverage: true
secrets: inherit

performance-gate:
Expand Down
Loading