Repository navigation
ci: Run e2e tests on PRs with a local image registry #346
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
Draft
andreiborza
wants to merge
10
commits into
master
Choose a base branch
from
ab/local-registry-e2e
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
ae4b081
ci: Run e2e tests on PRs with a local image registry
andreiborza faeffef
Split image build and publish, gate publish on e2e
andreiborza e7d1033
Add comment to replacement check
andreiborza fa22c53
Document local image tag and testing in a different repo
andreiborza 6921d0e
Move e2e tests to a reusable workflow
andreiborza 0c838eb
Keep provenance and push exact bytes with skopeo
andreiborza 3cc3d45
Pin Ubuntu 26.04 runners and set Sentry env fallbacks for forks
andreiborza c1bd1aa
Let MOCK fill the auth token in the manual commit range test
andreiborza 1d90d00
Merge remote-tracking branch 'origin/master' into ab/local-registry-e2e
andreiborza 73c6eb2
Reset docker tag to master after each release
andreiborza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| name: 'Use local action image' | ||
| description: |- | ||
| Loads the action image built in this workflow run into a local registry | ||
| and points the checked-out action.yml to it. The e2e tests use this, so | ||
| they can run before any image goes to ghcr.io (and on fork PRs, which get | ||
| a read-only token). | ||
|
|
||
| inputs: | ||
| path: | ||
| description: Directory of the checked-out action that the tests run. | ||
| default: '.' | ||
| required: false | ||
|
|
||
| runs: | ||
| using: 'composite' | ||
| steps: | ||
| - name: Download image | ||
| uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 | ||
| with: | ||
| name: action-release-image-${{ runner.arch == 'ARM64' && 'arm64' || 'amd64' }} | ||
| # Relative path, because `runner.temp` is a host path in container jobs. | ||
| path: .action-release-image | ||
|
|
||
| # Container jobs have the host docker socket mounted but usually no docker CLI. | ||
| - name: Install docker CLI | ||
| shell: bash | ||
| run: | | ||
| if command -v docker &> /dev/null; then | ||
| exit 0 | ||
| fi | ||
| curl -fsSL "https://download.docker.com/linux/static/stable/$(uname -m)/docker-29.9.1.tgz" \ | ||
| | tar -xz -C /usr/local/bin --strip-components=1 docker/docker | ||
|
|
||
| # The runner always pulls `docker://` images, so a local copy is not enough. | ||
| # The daemon trusts registries on localhost without TLS. | ||
| - name: Push image to local registry | ||
| shell: bash | ||
| run: | | ||
| docker run -d --rm -p 5000:5000 --name action-release-registry \ | ||
| registry:3.1.2@sha256:d4032d4cc323c1731c707931ecada07a53076eac38e3b61ae57533f170f2c6c3 | ||
| docker load -i .action-release-image/image.tar | ||
| rm -rf .action-release-image | ||
| # Retry until the registry is ready. A curl check does not work in | ||
| # container jobs, because there localhost is the job container. | ||
| for i in $(seq 1 10); do | ||
| docker push localhost:5000/action-release-image:pr && exit 0 | ||
| sleep 2 | ||
| done | ||
| exit 1 | ||
|
|
||
| - name: Point action.yml to local image | ||
| shell: bash | ||
| working-directory: ${{ inputs.path }} | ||
| run: | | ||
| sed -i -e 's|docker://ghcr.io/getsentry/action-release-image:.*|docker://localhost:5000/action-release-image:pr|' action.yml | ||
| # Make sure the replacement worked | ||
| grep -q 'docker://localhost:5000/action-release-image:pr' action.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a leftover from when the step created a sentry release that tested
set_commitsand is no longer needed.