-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Fix coverage link, streamline env vars in CI #12971
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
base: main
Are you sure you want to change the base?
Changes from 7 commits
6780a16
cb1a73a
d771cf0
1ccaa77
ef2875d
9a459e9
185c5a5
7a060c9
ba274be
8f14cb7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # These variables are ovveridden in CI with GitHub Action variables if triggered from pull-reqest or push; | ||
| # Locally, fallback to the current local git status | ||
| BRANCH="$(git branch --show-current)" | ||
| COMMIT_SHA="$(git rev-parse HEAD)" | ||
|
|
||
| # Read the CesiumJS version from package.json | ||
| CESIUM_VERSION=$(npm pkg get version | tr -d '"') | ||
|
|
||
| # Build artifact configuration | ||
| BUILD_ARTIFACT_PATH="cesium/${BRANCH}" | ||
| BUILD_ARTIFACT_BUCKET="s3://cesium-public-builds/${BUILD_ARTIFACT_PATH}" | ||
| BUILD_ARTIFACT_URL="https://ci-builds.cesium.com/${BUILD_ARTIFACT_PATH}" | ||
|
|
||
| INDEX_URL="${BUILD_ARTIFACT_URL}/index.html" | ||
| ZIP_URL="${BUILD_ARTIFACT_URL}/Cesium-${CESIUM_VERSION}.zip" | ||
| NPM_URL="${BUILD_ARTIFACT_URL}/cesium-${CESIUM_VERSION}.tgz" | ||
| COVERAGE_URL="${BUILD_ARTIFACT_URL}/Build/Coverage/index.html" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| BRANCH="$(jq -r .pull_request.head.ref ${GITHUB_EVENT_PATH})" | ||
| COMMIT_SHA="$(jq -r .pull_request.head.sha ${GITHUB_EVENT_PATH})" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| BRANCH=${GITHUB_REF_NAME} | ||
| COMMIT_SHA=${GITHUB_SHA} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| name: coverage | ||
| on: | ||
| pull_request: | ||
| concurrency: | ||
| group: coverage-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| coverage: | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| AWS_ACCESS_KEY_ID: ${{ secrets.DEV_AWS_ACCESS_KEY_ID }} | ||
| AWS_SECRET_ACCESS_KEY: ${{ secrets.DEV_AWS_SECRET_ACCESS_KEY }} | ||
| AWS_REGION: us-east-1 | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| permissions: | ||
| statuses: write | ||
| contents: read | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: install node 22 | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: "22" | ||
| - name: npm install | ||
| run: npm install | ||
| - name: set status pending | ||
| if: ${{ env.AWS_ACCESS_KEY_ID != '' }} | ||
| run: | | ||
| npx @dotenvx/dotenvx run -f ./.github/workflows/.env.pull_request -- \ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are we calling Also as an aside for my curiosity, what is the reason you went with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I chose There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes. The default |
||
| node ./scripts/setCommitStatus.js coverage pending | ||
| - name: build | ||
| run: npm run build | ||
| - name: coverage (firefox) | ||
| run: npm run coverage -- --browsers FirefoxHeadless --webgl-stub --failTaskOnError --suppressPassed | ||
| - name: upload coverage artifacts | ||
| if: ${{ env.AWS_ACCESS_KEY_ID != '' }} | ||
| run: | | ||
| npx @dotenvx/dotenvx run -f ./.github/workflows/.env.pull_request -f .env \ | ||
| -- sh -c \ | ||
| 'aws s3 sync ./Build/Coverage $BUILD_ARTIFACT_BUCKET/Build/Coverage --delete' | ||
| - name: set status success | ||
| if: ${{ env.AWS_ACCESS_KEY_ID != '' }} | ||
| run: | | ||
| npx @dotenvx/dotenvx run -f ./.github/workflows/.env.pull_request -- \ | ||
| node ./scripts/setCommitStatus.js coverage ${{ job.status }} | ||
Uh oh!
There was an error while loading. Please reload this page.