-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: fix arm64 build Closes #234 * bump version * remove Dockerfile.arm64 * fix formatting * fix tags * remove govulncheck CI job * remove non-existing flags * env vars * Revert "env vars" This reverts commit 484c67e. * remove extra description * only release latest if it's indeed latest tag * fix lint job * simplify * remove outdated comment * remove unnecessary LD_LIBRARY_PATH * rename test-fast to test * build docker on PR * fix lint issues * fix arm again * remove pull_request
- Loading branch information
Showing
14 changed files
with
147 additions
and
213 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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 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 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 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 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.