-
Notifications
You must be signed in to change notification settings - Fork 79
ci: fix arm64 build #240
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
ci: fix arm64 build #240
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
39500f9
ci: fix arm64 build
melekes 38e77ef
bump version
melekes 774fabb
remove Dockerfile.arm64
melekes f1ae7a5
fix formatting
melekes 177b66b
fix tags
melekes dd948c9
remove govulncheck CI job
melekes 1f3f0ad
remove non-existing flags
melekes 484c67e
env vars
melekes f8adb57
Revert "env vars"
melekes 0116e58
remove extra description
melekes 3213a93
only release latest if it's indeed latest tag
melekes bda0345
fix lint job
melekes 0f41401
simplify
melekes b8add78
remove outdated comment
melekes 73acfe2
remove unnecessary LD_LIBRARY_PATH
melekes 446ff59
rename test-fast to test
melekes d0bcb50
build docker on PR
melekes fa712b5
fix lint issues
melekes 47113cf
fix arm again
melekes 1472632
remove pull_request
melekes 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
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| name: "Conventional PR Title" | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| types: | ||
|
|
||
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 |
|---|---|---|
| @@ -1,62 +1,90 @@ | ||
| # This workflow builds and pushes a new version of the build container image | ||
| # when the tools directory changes on main. Edit tools/Dockerfile. | ||
| # | ||
| # This workflow does not push a new image until it is merged, so tests that | ||
| # depend on changes in this image will not pass until this workflow succeeds. | ||
| # For that reason, changes here should be done in a separate PR in advance of | ||
| # work that depends on them. | ||
| # | ||
| # To build the test image locally, run: | ||
| # make docker-test-image | ||
|
|
||
| name: Docker testing image | ||
| name: Build Docker Image | ||
| on: | ||
| workflow_dispatch: # allow running workflow manually | ||
| workflow_dispatch: | ||
| inputs: | ||
| refName: | ||
| description: 'Git ref name' | ||
| tag: | ||
| description: "The tag of the image to build" | ||
| required: true | ||
| default: 'main' | ||
| push: | ||
| tags: | ||
| - "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
| - "v[0-9]+.[0-9]+.[0-9]+-alpha.[0-9]+" # e.g. v0.37.0-alpha.1, v0.38.0-alpha.10 | ||
| - "v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+" # e.g. v0.37.0-beta.1, v0.38.0-beta.10 | ||
| - "v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+" # e.g. v0.37.0-rc1, v0.38.0-rc10 | ||
| type: string | ||
| is_latest: | ||
| description: "Push as latest?" | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
|
||
| env: | ||
| ORG: cometbft | ||
| IMAGE_NAME: cometbft-db-testing | ||
| GIT_TAG: "${{ inputs.tag }}" | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
| build-image-at-tag: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-24.04 | ||
| platform: linux/amd64 | ||
| - os: ubuntu-24.04-arm | ||
| platform: linux/arm64 | ||
| runs-on: ${{ matrix.os }} | ||
| outputs: | ||
| digest-${{ matrix.platform }}: ${{ steps.build.outputs.digest }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: "${{ env.GIT_TAG }}" | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Set up Docker Build | ||
| uses: docker/setup-buildx-action@v3.8.0 | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Login to DockerHub | ||
| if: ${{ github.event_name != 'pull_request' }} | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Publish to Docker Hub (amd64) | ||
| - name: Build and push image | ||
| id: build | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| context: ./tools | ||
| platforms: ${{ matrix.platform }} | ||
| file: ./tools/Dockerfile | ||
| platforms: linux/amd64 | ||
| push: true | ||
| tags: | | ||
| cometbft/cometbft-db-testing:latest | ||
| cometbft/cometbft-db-testing:${{ github.event.inputs.refName }} | ||
| ${{ env.ORG }}/${{ env.IMAGE_NAME }}:${{ env.GIT_TAG }} | ||
| push: true | ||
|
|
||
| - name: Publish to Docker Hub (arm64) | ||
| uses: docker/build-push-action@v6 | ||
| merge: | ||
| runs-on: ubuntu-latest | ||
| needs: build-image-at-tag | ||
| steps: | ||
| - name: Get sanitized Docker tag | ||
| run: echo "DOCKER_TAG=$(echo $GIT_TAG | sed 's/[^a-zA-Z0-9\.]/-/g')" >> $GITHUB_ENV | ||
|
|
||
| - name: Login to DockerHub | ||
| if: ${{ github.event_name != 'pull_request' }} | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| context: ./tools | ||
| file: ./tools/Dockerfile.arm64 | ||
| platforms: linux/arm64 | ||
| push: true | ||
| tags: | | ||
| cometbft/cometbft-db-testing:latest | ||
| cometbft/cometbft-db-testing:${{ github.event.inputs.refName }} | ||
| username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
| password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
|
||
| - name: Create Multi-Arch Manifest | ||
| run: | | ||
| docker buildx imagetools create \ | ||
| --tag ${{ env.ORG }}/${{ env.IMAGE_NAME }}:${{ env.DOCKER_TAG }} \ | ||
| ${{ env.ORG }}/${{ env.IMAGE_NAME }}@${{ needs.build-image-at-tag.outputs.digest-linux/amd64 }} \ | ||
| ${{ env.ORG }}/${{ env.IMAGE_NAME }}@${{ needs.build-image-at-tag.outputs.digest-linux/arm64 }} | ||
|
|
||
| - name: Tag and Push Latest (if applicable) | ||
| if: ${{ inputs.is_latest == true }} | ||
| run: | | ||
| docker buildx imagetools create \ | ||
| --tag ${{ env.ORG }}/${{ env.IMAGE_NAME }}:latest \ | ||
| ${{ env.ORG }}/${{ env.IMAGE_NAME }}@${{ needs.build-image-at-tag.outputs.digest-linux/amd64 }} \ | ||
| ${{ env.ORG }}/${{ env.IMAGE_NAME }}@${{ needs.build-image-at-tag.outputs.digest-linux/arm64 }} | ||
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| name: Lint | ||
|
|
||
| on: | ||
| pull_request: | ||
| merge_group: | ||
|
|
@@ -11,23 +10,27 @@ concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
|
||
| env: | ||
| ORG: cometbft | ||
| IMAGE_NAME: cometbft-db-testing | ||
|
|
||
| jobs: | ||
| golangci: | ||
| # We need to run the linter on the same image we use for building, since it | ||
| # needs the C libraries installed for the dependencies to typecheck. | ||
| runs-on: ubuntu-latest | ||
| container: cometbft/cometbft-db-testing | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - run: echo "GO_VERSION=$(cat .github/workflows/go-version.env | grep GO_VERSION | cut -d '=' -f2)" >> $GITHUB_ENV | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - uses: actions/setup-go@v5 | ||
| - name: Build and load | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| go-version: ${{ env.GO_VERSION }} | ||
| platforms: linux/amd64 | ||
| file: ./tools/Dockerfile | ||
| tags: "${{ env.ORG }}/${{ env.IMAGE_NAME }}:latest" | ||
| load: true | ||
|
|
||
| - uses: golangci/[email protected] | ||
| with: | ||
| args: --timeout 10m | ||
| version: latest | ||
| github-token: ${{ secrets.github_token }} | ||
| - name: lint | ||
| run: | | ||
| NON_INTERACTIVE=1 make docker-lint | ||
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,48 @@ | ||
| name: Test | ||
| on: | ||
| pull_request: | ||
| merge_group: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | ||
|
|
||
| env: | ||
| ORG: cometbft | ||
| IMAGE_NAME: cometbft-db-testing | ||
|
|
||
| jobs: | ||
| test: | ||
| strategy: | ||
| fail-fast: true | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-24.04 | ||
| platform: linux/amd64 | ||
| - os: ubuntu-24.04-arm | ||
| platform: linux/arm64 | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Build and load | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| platforms: ${{ matrix.platform }} | ||
| file: ./tools/Dockerfile | ||
| tags: "${{ env.ORG }}/${{ env.IMAGE_NAME }}:latest" | ||
| load: true | ||
|
|
||
| - name: test & coverage report creation | ||
| run: | | ||
| NON_INTERACTIVE=1 make docker-test | ||
|
|
||
| - uses: codecov/codecov-action@v4 | ||
| with: | ||
| file: ./coverage.txt |
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
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.
Uh oh!
There was an error while loading. Please reload this page.