Repository navigation
chore: docker workflow refactor #2820
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
Changes from all commits
ae4db56
4450668
ee4cf3d
11b9797
7c7fba0
a8e26bf
4f5f756
6b740fd
fa932c4
8df4b4b
dfa9266
15daa50
dd4a854
71ce4ca
52a0c80
e9f72a8
db4c064
ec03c9c
15799e8
0baeed0
fe3dded
89a8296
3440dcb
009ab68
af13741
be661cb
616347b
4cb7bbe
e95423b
a81ba54
b6bca3e
5d38f73
14f8f8d
811e200
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,81 @@ | ||
| --- | ||
| name: CI | ||
| "on": | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| merge_group: | ||
|
|
||
| permissions: {} | ||
| jobs: | ||
| determine-image-tag: | ||
| name: Determine Image Tag | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| tag: ${{ steps.set-tag.outputs.tag }} | ||
| steps: | ||
| - name: Set image tag | ||
| id: set-tag | ||
| run: | | ||
| if [ -n "${{ github.event.pull_request.number }}" ]; then | ||
| TAG="pr-${{ github.event.pull_request.number }}" | ||
| echo "::notice::Using PR-based tag: $TAG" | ||
| else | ||
| # Sanitize ref_name by replacing / with - | ||
| TAG="${{ github.ref_name }}" | ||
| TAG="${TAG//\//-}" | ||
| echo "::notice::Using branch/tag-based tag: $TAG" | ||
| fi | ||
|
|
||
| # Validate tag format | ||
| if [[ ! "$TAG" =~ ^[a-zA-Z0-9._-]+$ ]]; then | ||
| echo "::error::Invalid image tag format: $TAG" | ||
| exit 1 | ||
| fi | ||
|
|
||
| echo "tag=$TAG" >> $GITHUB_OUTPUT | ||
|
|
||
| lint: | ||
| permissions: | ||
| contents: read | ||
| uses: ./.github/workflows/lint.yml | ||
|
|
||
| docker: | ||
| needs: determine-image-tag | ||
| uses: ./.github/workflows/docker-build-push.yml | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| with: | ||
| image-tag: ${{ needs.determine-image-tag.outputs.tag }} | ||
| apps: | | ||
| [ | ||
| {"name": "ev-node-evm-single", "dockerfile": "apps/evm/single/Dockerfile"}, | ||
| {"name": "ev-node-testapp", "dockerfile": "apps/testapp/Dockerfile"} | ||
| ] | ||
|
|
||
| test: | ||
| permissions: | ||
| actions: read | ||
| contents: read | ||
| uses: ./.github/workflows/test.yml | ||
| secrets: inherit | ||
|
|
||
| docker-tests: | ||
| needs: [determine-image-tag, docker] | ||
| uses: ./.github/workflows/docker-tests.yml | ||
| secrets: inherit | ||
| permissions: | ||
| contents: read | ||
| with: | ||
| image-tag: ${{ needs.determine-image-tag.outputs.tag }} | ||
|
|
||
| proto: | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| uses: ./.github/workflows/proto.yml |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| --- | ||
| # This workflow builds and pushes Docker images to GHCR | ||
| name: Build Docker Images | ||
| permissions: {} | ||
| "on": | ||
| workflow_call: | ||
| inputs: | ||
| image-tag: | ||
| required: true | ||
| type: string | ||
| description: 'Docker image tag (e.g., v1.2.3, pr-123, sha-abc123)' | ||
| apps: | ||
| required: true | ||
| type: string | ||
| description: 'JSON array of apps to build (e.g., [{"name": "testapp", "dockerfile": "apps/testapp/Dockerfile"}])' | ||
|
|
||
| jobs: | ||
| build-images: | ||
| name: Build ${{ matrix.app.name }} | ||
| # skip building images for merge groups as they are already built on PRs and main | ||
| if: github.event_name != 'merge_group' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| strategy: | ||
| matrix: | ||
| app: ${{ fromJson(inputs.apps) }} | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build Docker Images' step [Uses Step](1) uses 'docker/setup-buildx-action' with ref 'v3', not a pinned commit hash
|
||
|
|
||
| - name: Log in to GHCR | ||
| uses: docker/login-action@v3 | ||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build Docker Images' step [Uses Step](1) uses 'docker/login-action' with ref 'v3', not a pinned commit hash
|
||
| with: | ||
| registry: ghcr.io | ||
| username: ${{ github.actor }} | ||
| password: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Build and push ${{ matrix.app.name }} Docker image | ||
| uses: docker/build-push-action@v6 | ||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow
Unpinned 3rd party Action 'Build Docker Images' step [Uses Step](1) uses 'docker/build-push-action' with ref 'v6', not a pinned commit hash
|
||
| with: | ||
| context: . | ||
| file: ${{ matrix.app.dockerfile }} | ||
| push: true | ||
| platforms: linux/amd64,linux/arm64 | ||
| tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.app.name }}:${{ inputs.image-tag }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| --- | ||
| # This workflow runs tests that require Docker images to be built first | ||
| name: Docker E2E Tests | ||
| permissions: {} | ||
|
auricom marked this conversation as resolved.
Resolved
|
||
| "on": | ||
| workflow_call: | ||
| inputs: | ||
| image-tag: | ||
| required: true | ||
| type: string | ||
| workflow_dispatch: | ||
| inputs: | ||
| image-tag: | ||
| description: 'Docker image tag to use for tests (e.g., v1.2.3, pr-123, sha-abc123)' | ||
| required: true | ||
| type: string | ||
|
|
||
| jobs: | ||
| docker-tests: | ||
| permissions: | ||
| contents: read | ||
| name: Docker E2E Tests | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: set up go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: ./test/docker-e2e/go.mod | ||
| - name: Run Docker E2E Tests | ||
| run: make test-docker-e2e | ||
| env: | ||
| EV_NODE_IMAGE_REPO: ghcr.io/${{ github.repository_owner }}/ev-node-testapp | ||
| EV_NODE_IMAGE_TAG: ${{ inputs.image-tag }} | ||
|
|
||
| docker-upgrade-tests: | ||
|
|
||
| name: Docker Upgrade E2E Tests | ||
| permissions: | ||
| contents: read | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - name: set up go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: ./test/docker-e2e/go.mod | ||
| - name: Run Docker Upgrade E2E Tests | ||
| run: make test-docker-upgrade-e2e | ||
| env: | ||
| EVM_SINGLE_IMAGE_REPO: ghcr.io/${{ github.repository_owner }}/ev-node-evm-single | ||
| EVM_SINGLE_NODE_IMAGE_TAG: ${{ inputs.image-tag }} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.