Skip to content

Commit

Permalink
build: fix the image to work with golangci-lint
Browse files Browse the repository at this point in the history
In #195 I updated the Go version, and also swapped from Debian to Alpine for
the base image. This was OK for the build, but it turns out we also use the
same image to run golangci-lint. That action uses a binary for a different
architecture, which fails on this image.

So:
- Keep the Go version, but revert the base image.
- Add some documentation to the workflow configs.
  • Loading branch information
creachadair committed Nov 8, 2021
1 parent 8882f27 commit 1f7f7c7
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ jobs:
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"

Test:
# The custom image here contains pre-built libraries for leveldb and
# rocksdb, which are needed to build and test those modules.
# To update the container image, see docker.yml.
runs-on: ubuntu-latest
container: tendermintdev/docker-tm-db-testing
steps:
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# This workflow builds and pushes a new version of the build container image
# when the tools directory changes on master. 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.

name: Build & Push TM-DB-Testing
on:
pull_request:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ on:

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: tendermintdev/docker-tm-db-testing
steps:
- uses: actions/checkout@v2
- uses: golangci/golangci-lint-action@v2.5.2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
# Required: the version of golangci-lint is required and must be
# specified without patch version: we always use the latest patch
# version.
version: v1.30
args: --timeout 10m
github-token: ${{ secrets.github_token }}
11 changes: 10 additions & 1 deletion tools/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
FROM golang:1.16-alpine
# This file defines the container image used to build and test tm-db in CI.
# The CI workflows use the latest tag of tendermintdev/docker-tm-db-testing
# built from these settings.
#
# The jobs defined in the Build & Push workflow will build and update the image
# when changes to this file are merged. If you have other changes that require
# updates here, merge the changes here first and let the image get updated (or
# push a new version manually) before PRs that depend on them.

FROM golang:1.17-alpine

ENV LD_LIBRARY_PATH=/usr/local/lib

Expand Down

0 comments on commit 1f7f7c7

Please sign in to comment.