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

Speedups and enhancements for GitHub Actions CI workflows #477

Merged
merged 25 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3212e65
Upgrade step-security/harden-runner v2.6.0 -> v2.10.1
TylerHendrickson Oct 3, 2024
c2e4762
Downgrade step-security/harden-runner v2.10.1 -> v2.10.0
TylerHendrickson Oct 3, 2024
d428ee1
Use recommended CI flags for `yarn install`
TylerHendrickson Oct 3, 2024
f55a2a0
Upgrade actions/upload-artifact v4.3.3 -> v4.4.0
TylerHendrickson Oct 3, 2024
cbbbedb
Upgrade actions/download-artifact v4.1.7 -> v4.1.8
TylerHendrickson Oct 3, 2024
61ef47d
fix typo
TylerHendrickson Oct 3, 2024
d80fded
Upgrade actions/setup-node v4.0.0 -> v4.0.4
TylerHendrickson Oct 3, 2024
23a3aea
Mark `fsevents` dependency as optional
TylerHendrickson Oct 3, 2024
0574e18
Dedupe dependencies
TylerHendrickson Oct 3, 2024
6cd5bca
Remove extraneous package-lock.json (we use yarn)
TylerHendrickson Oct 3, 2024
aa3514f
Rebuild yarn.lock
TylerHendrickson Oct 3, 2024
b7074d5
Fix `yarn install` flags (not using zero installs)
TylerHendrickson Oct 3, 2024
4d87311
Trim supportedArchitectures
TylerHendrickson Oct 3, 2024
1da56ee
Write each test suite coverage report to its own step summary
TylerHendrickson Oct 4, 2024
59212ac
Add summary link to Test Coverage section of QA Summary comment
TylerHendrickson Oct 4, 2024
8957d0b
Move pusher status and workflow run links to top of comments
TylerHendrickson Oct 4, 2024
0f36a3f
Testing removal of extra "Install dependencies" steps
TylerHendrickson Oct 4, 2024
bd77fbc
(follow up) Save/restore node_modules
TylerHendrickson Oct 4, 2024
d45d240
Fail when node_modules cache is missed
TylerHendrickson Oct 4, 2024
ca65750
Collapse coverage reports in step summaries
TylerHendrickson Oct 4, 2024
f7fd560
Allow Prepare for QA to use node_modules cache
TylerHendrickson Oct 4, 2024
6cc04dd
Allow Prepare for QA to use node_modules cache
TylerHendrickson Oct 4, 2024
36eb72f
Exclude `**/*.sdl.ts` files from Jest coverage
TylerHendrickson Oct 4, 2024
024b1d0
Revert some of yarn.lock
TylerHendrickson Oct 4, 2024
a139dac
Merge branch 'main' into gha-maint/base
TylerHendrickson Oct 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/aws-auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
aws-secret-access-key: ${{ steps.encrypt-aws-secret-access-key.outputs.out }}
aws-session-token: ${{ steps.encrypt-aws-session-token.outputs.out }}
steps:
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
- uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.0
with:
disable-sudo: true
egress-policy: block
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ jobs:
attestation-artifacts-key: ${{ env.ATTESTATION_ARTIFACTS_KEY }}
attestation-artifacts-path: ${{ steps.store-attestations.outputs.path }}
steps:
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
- uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.0
with:
disable-sudo: true
egress-policy: audit
Expand Down Expand Up @@ -269,7 +269,7 @@ jobs:
INSPECT_NAME: ${{ inputs.docker-image-registry }}/${{ inputs.api-image-name }}@${{ steps.build-push.outputs.digest }}
- name: Upload attestations
if: steps.store-attestations.outcome == 'success'
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: ${{ env.ATTESTATION_ARTIFACTS_KEY }}
path: ${{ steps.store-attestations.outputs.path }}
Expand All @@ -293,7 +293,7 @@ jobs:
attestation-artifacts-key: ${{ env.ATTESTATION_ARTIFACTS_KEY }}
attestation-artifacts-path: ${{ steps.store-attestations.outputs.path }}
steps:
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
- uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.0
with:
disable-sudo: true
egress-policy: audit
Expand Down Expand Up @@ -403,7 +403,7 @@ jobs:
INSPECT_NAME: ${{ inputs.docker-image-registry }}/${{ inputs.console-image-name }}@${{ steps.build-push.outputs.digest }}
- name: Upload attestations
if: steps.store-attestations.outcome == 'success'
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: ${{ env.ATTESTATION_ARTIFACTS_KEY }}
path: ${{ steps.store-attestations.outputs.path }}
Expand All @@ -427,7 +427,7 @@ jobs:
artifacts-path: ${{ env.ARTIFACTS_PATH }}
checksums-sha256: ${{ steps.checksums.outputs.sha256 }}
steps:
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
- uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.0
with:
disable-sudo: true
egress-policy: audit
Expand All @@ -437,12 +437,12 @@ jobs:
show-progress: 'false'
persist-credentials: 'false'
- name: Setup Node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: .nvmrc
cache: yarn
- name: Install dependencies
run: yarn install
run: yarn install --immutable
- name: Build the api side
run: yarn rw build api
env:
Expand Down Expand Up @@ -478,7 +478,7 @@ jobs:
ENDOFREPORT
cat "$REPORT_FILE" >> $GITHUB_STEP_SUMMARY
- name: Upload build artifact
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: ${{ env.ARTIFACTS_KEY }}
path: ${{ env.ARTIFACTS_PATH }}
Expand All @@ -501,7 +501,7 @@ jobs:
artifacts-path: ${{ env.ARTIFACTS_PATH }}
checksums-sha256: ${{ steps.checksums.outcome.sha256 }}
steps:
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
- uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.0
with:
disable-sudo: true
egress-policy: audit
Expand Down Expand Up @@ -564,7 +564,7 @@ jobs:
ENDOFREPORT
cat "$REPORT_FILE" >> $GITHUB_STEP_SUMMARY
- name: Upload build artifact
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: ${{ env.ARTIFACTS_KEY }}
path: ${{ env.ARTIFACTS_PATH }}
Expand All @@ -587,7 +587,7 @@ jobs:
artifacts-path: ${{ env.ARTIFACTS_PATH }}
checksums-sha256: ${{ steps.checksums.outputs.sha256 }}
steps:
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
- uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.0
with:
disable-sudo: true
egress-policy: audit
Expand All @@ -597,13 +597,13 @@ jobs:
show-progress: 'false'
persist-credentials: 'false'
- name: Setup Node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
with:
node-version-file: .nvmrc
cache: yarn
cache-dependency-path: yarn.lock
- name: Install dependencies
run: yarn install
run: yarn install --immutable
- name: Write env vars for build
run: cat <<< "$DOTENV_FOR_BUILD" >> .env
env:
Expand Down Expand Up @@ -636,7 +636,7 @@ jobs:
ENDOFREPORT
cat "$REPORT_FILE" >> $GITHUB_STEP_SUMMARY
- name: Upload build artifact
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: ${{ env.ARTIFACTS_KEY }}
path: ${{ env.ARTIFACTS_PATH }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/code-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
- uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.0
with:
disable-sudo: true
egress-policy: block
Expand All @@ -42,7 +42,7 @@ jobs:
contents: read
security-events: write
steps:
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
- uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.0
with:
disable-sudo: true
egress-policy: audit
Expand All @@ -67,7 +67,7 @@ jobs:
permissions:
contents: read
steps:
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
- uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.0
with:
disable-sudo: true
egress-policy: block
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ jobs:
github.com:443
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- name: Download website build artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: ${{ needs.build.outputs.web-artifacts-key }}
path: ${{ needs.build.outputs.web-artifacts-path }}
- name: Download docker build attestation artifacts for console image
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: ${{ needs.build.outputs.console-attestation-artifacts-key }}
path: ${{ needs.build.outputs.console-attestation-artifacts-path }}
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/publish-qa-results.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,29 @@ jobs:
contents: read
pull-requests: write
steps:
- uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
- uses: step-security/harden-runner@446798f8213ac2e75931c1b0769676d927801858 # v2.10.0
with:
disable-sudo: true
egress-policy: audit
- name: Create URL to workflow run
id: workflow-run-summary-url
run: |
RUN_URL="$GH_SERVER/$GH_REPO/actions/runs/$GH_RUN_ID"
echo "url=$RUN_URL" >> $GITHUB_OUTPUT
echo "attempt-url=$RUN_URL/attempts/${{ github.run_attempt }}" >> $GITHUB_OUTPUT
env:
GH_SERVER: ${{ github.server_url }}
GH_REPO: ${{ github.repository }}
GH_RUN_ID: ${{ github.run_id }}
- name: Write the report markdown file
run: |
REPORT_FILE=$(mktemp -t summary.md.XXXXX)
echo "REPORT_FILE=$REPORT_FILE" >> $GITHUB_ENV
cat >> $REPORT_FILE << 'ENDOFREPORT'
## QA Summary

*Pusher: @${{ env.GH_ACTOR }}, Action: `${{ env.GH_ACTION }}`, Workflow: [`${{ env.GH_WORKFLOW }}`](${{ env.WORKFLOW_RUN_SUMMARY_URL }})*

_[See our documentation for tips on how to resolve failing QA checks.](${{ env.GH_SERVER}}/${{ env.GH_REPO }}/blob/main/docs/resolving-qa-failures.md)_

| QA Check | Result |
Expand All @@ -76,6 +88,8 @@ jobs:

### Test Coverage

_View the [workflow summary](${{ env.WORKFLOW_RUN_SUMMARY_ATTEMPT_URL }}) for individual coverage reports if this comment is truncated._

<details>
<summary>Coverage report for <code>api</code> suite</summary>

Expand All @@ -95,8 +109,6 @@ jobs:
${{ env.PYTHON_COVERAGE_REPORT }}

</details>

*Pusher: @${{ env.GH_ACTOR }}, Action: `${{ env.GH_ACTION }}`, Workflow: [`${{ env.GH_WORKFLOW }}`](${{ env.GH_SERVER}}/${{ env.GH_REPO }}/actions/runs/${{ env.GH_RUN_ID }})*
ENDOFREPORT
env:
API_TEST_OUTCOME: ${{ inputs.api-test-outcome }}
Expand All @@ -108,6 +120,8 @@ jobs:
ESLINT_OUTCOME: ${{ inputs.eslint-outcome }}
RUFF_OUTCOME: ${{ inputs.ruff-outcome }}
TFLINT_OUTCOME: ${{ inputs.tflint-outcome }}
WORKFLOW_RUN_SUMMARY_URL: ${{ steps.workflow-run-summary-url.outputs.url }}
WORKFLOW_RUN_SUMMARY_ATTEMPT_URL: ${{ steps.workflow-run-summary-url.outputs.attempt-url }}
GH_ACTOR: ${{ github.actor }}
GH_ACTION: ${{ github.event_name }}
GH_WORKFLOW: ${{ github.workflow }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-terraform-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:
cat >> $REPORT_FILE << 'ENDOFREPORT'
## Terraform Summary

*Pusher: @${{ env.GH_ACTOR }}, Action: `${{ env.GH_ACTION }}`, Workflow: [`${{ env.GH_WORKFLOW }}`](${{ env.GH_SERVER}}/${{ env.GH_REPO }}/actions/runs/${{ env.GH_RUN_ID }})*

| Step | Result |
|:-----------------------------|:-------:|
| 🖌 Terraform Format & Style | ${{ (env.TF_FMT_OUTCOME == 'success' && '✅') || (env.TF_FMT_OUTCOME == 'skipped' && '➖') || '❌' }} |
Expand All @@ -82,8 +84,6 @@ jobs:
${{ env.TF_PLAN_SUMMARY }}

</details>

*Pusher: @${{ env.GH_ACTOR }}, Action: `${{ env.GH_ACTION }}`, Workflow: [`${{ env.GH_WORKFLOW }}`](${{ env.GH_SERVER}}/${{ env.GH_REPO }}/actions/runs/${{ env.GH_RUN_ID }})*
ENDOFREPORT
env:
TF_FMT_OUTCOME: ${{ inputs.tf-fmt-outcome }}
Expand Down
Loading
Loading