.github/workflows: add check-tidy #97
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
name: TRON - Relayer | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build-check: | |
name: Build & Unit Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f # v31 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Run build | |
run: | | |
pushd relayer | |
nix develop -c go build -v ./... | |
- name: Run tests | |
run: | | |
pushd relayer | |
nix develop -c go test -v -count=1 -p=1 -tags=integration ./... | |
build-pkgs: | |
name: Build and package (Nix and Docker) | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: Install Nix | |
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f # v31 | |
with: | |
nix_path: nixpkgs=channel:nixos-unstable | |
- name: Run build - Nix | |
run: nix build -v .#chainlink-tron | |
- name: Run build - Docker (via host) | |
run: nix develop -c ./scripts/build/make-docker.sh | |
- name: Run build - Docker (via Docker builder) | |
run: nix develop -c ./scripts/build/make-docker.sh --docker-builder | |
check-tidy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
cache-dependency-path: relayer/go.sum | |
go-version-file: relayer/go.mod | |
- name: Ensure modules are tidy | |
run: | | |
go install github.com/jmank88/[email protected] | |
gomods tidy | |
git add --all | |
git diff --minimal --cached --exit-code | |
- name: Ensure mockery has been run | |
run: | | |
grep -rl "^// Code generated by mockery" | grep .go$ | xargs -r rm | |
gomods -go generate ./... | |
git add --all | |
git diff --stat --cached --exit-code |