Skip to content

ref(dev): Improve labeling of checkout step in GHA #5156

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

Merged
merged 2 commits into from
May 24, 2022
Merged
Changes from all commits
Commits
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
73 changes: 48 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,35 @@ env:
BUILD_CACHE_KEY: ${{ github.event.inputs.commit || github.sha }}

jobs:
job_get_metadata:
name: Get Metadata
runs-on: ubuntu-latest
steps:
- name: Check out current commit
uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_COMMIT }}
# We need to check out not only the fake merge commit between the PR and the base branch which GH creates, but
# also its parents, so that we can pull the commit message from the head commit of the PR
fetch-depth: 2
- name: Get metadata
id: get_metadata
# We need to try a number of different options for finding the head commit, because each kind of trigger event
# stores it in a different location
run: |
COMMIT_SHA=$(git rev-parse --short ${{ github.event.pull_request.head.sha || github.event.head_commit.id || env.HEAD_COMMIT }})
echo "COMMIT_SHA=$COMMIT_SHA" >> $GITHUB_ENV
echo "COMMIT_MESSAGE=$(git log -n 1 --pretty=format:%s $COMMIT_SHA)" >> $GITHUB_ENV
outputs:
commit_label: "${{ env.COMMIT_SHA }}: ${{ env.COMMIT_MESSAGE }}"

job_install_deps:
name: Install Dependencies
needs: job_get_metadata
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Check out current commit (${{ env.HEAD_COMMIT }})
- name: "Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})"
uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_COMMIT }}
Expand All @@ -70,11 +93,11 @@ jobs:

job_build:
name: Build
needs: job_install_deps
needs: [ job_get_metadata, job_install_deps ]
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Check out current commit (${{ env.HEAD_COMMIT }})
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_COMMIT }}
Expand Down Expand Up @@ -150,13 +173,13 @@ jobs:

job_size_check:
name: Size Check
needs: job_build
needs: [job_get_metadata, job_build]
timeout-minutes: 15
runs-on: ubuntu-latest
# Size Check will error out outside of the context of a PR
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Check out current commit (${{ env.HEAD_COMMIT }})
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_COMMIT }}
Expand Down Expand Up @@ -184,11 +207,11 @@ jobs:

job_lint:
name: Lint
needs: job_build
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Check out current commit (${{ env.HEAD_COMMIT }})
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_COMMIT }}
Expand All @@ -211,11 +234,11 @@ jobs:

job_circular_dep_check:
name: Circular Dependency Check
needs: job_build
needs: [job_get_metadata, job_build]
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Check out current commit (${{ env.HEAD_COMMIT }})
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_COMMIT }}
Expand All @@ -238,12 +261,12 @@ jobs:

job_artifacts:
name: Upload Artifacts
needs: job_build
needs: [job_get_metadata, job_build]
runs-on: ubuntu-latest
# Build artifacts are only needed for releasing workflow.
if: startsWith(github.ref, 'refs/heads/release/')
steps:
- name: Check out current commit (${{ github.sha }})
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_COMMIT }}
Expand Down Expand Up @@ -275,15 +298,15 @@ jobs:

job_unit_test:
name: Test (Node ${{ matrix.node }})
needs: job_build
needs: [job_get_metadata, job_build]
continue-on-error: true
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
node: [8, 10, 12, 14, 16, 18]
steps:
- name: Check out current commit (${{ env.HEAD_COMMIT }})
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_COMMIT }}
Expand Down Expand Up @@ -312,15 +335,15 @@ jobs:

job_nextjs_integration_test:
name: Test @sentry/nextjs on (Node ${{ matrix.node }})
needs: job_build
needs: [job_get_metadata, job_build]
continue-on-error: true
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
matrix:
node: [10, 12, 14, 16, 18]
steps:
- name: Check out current commit (${{ env.HEAD_COMMIT }})
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_COMMIT }}
Expand Down Expand Up @@ -349,12 +372,12 @@ jobs:
# separate job allows them to run in parallel with the other tests.
job_ember_tests:
name: Test @sentry/ember
needs: job_build
needs: [job_get_metadata, job_build]
continue-on-error: true
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Check out current commit (${{ env.HEAD_COMMIT }})
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_COMMIT }}
Expand Down Expand Up @@ -388,7 +411,7 @@ jobs:

job_browser_playwright_tests:
name: Playwright - ${{ (matrix.tracing_only && 'Browser + Tracing') || 'Browser' }} (${{ matrix.bundle }})
needs: job_build
needs: [job_get_metadata, job_build]
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -410,7 +433,7 @@ jobs:
- bundle: cjs
tracing_only: false
steps:
- name: Check out current commit (${{ env.HEAD_COMMIT }})
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_COMMIT }}
Expand Down Expand Up @@ -439,7 +462,7 @@ jobs:

job_browser_integration_tests:
name: Old Browser Integration Tests (${{ matrix.browser }})
needs: job_build
needs: [job_get_metadata, job_build]
runs-on: ubuntu-latest
timeout-minutes: 10
continue-on-error: true
Expand All @@ -450,7 +473,7 @@ jobs:
- FirefoxHeadless
- WebkitHeadless
steps:
- name: Check out current commit (${{ env.HEAD_COMMIT }})
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_COMMIT }}
Expand Down Expand Up @@ -478,12 +501,12 @@ jobs:

job_browser_build_tests:
name: Browser Build Tests
needs: job_build
needs: [job_get_metadata, job_build]
runs-on: ubuntu-latest
timeout-minutes: 5
continue-on-error: true
steps:
- name: Check out current commit (${ env.HEAD_COMMIT }})
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_COMMIT }}
Expand Down Expand Up @@ -512,15 +535,15 @@ jobs:

job_node_integration_tests:
name: Node SDK Integration Tests (${{ matrix.node }})
needs: job_build
needs: [job_get_metadata, job_build]
runs-on: ubuntu-latest
timeout-minutes: 10
continue-on-error: true
strategy:
matrix:
node: [10, 12, 14, 16, 18]
steps:
- name: Check out current commit (${{ github.sha }})
- name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }})
uses: actions/checkout@v2
with:
ref: ${{ env.HEAD_COMMIT }}
Expand Down