add lock for concurrently writing to map #2909
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: TON - Build Relayer Package | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
permissions: | |
contents: read | |
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: nix develop -c go build -v ./... | |
- name: Run unit tests | |
run: nix develop -c go test -v -count=1 -p=1 -timeout 30m ./... | |
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-ton | |
- 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: 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: Ensure modules are tidy | |
run: | | |
nix develop -c go tool gomods tidy | |
git add --all | |
git diff --minimal --cached --exit-code | |
- name: Ensure mockery and go.md are up to date | |
run: | | |
nix develop -c grep -rl "^// Code generated by mockery" | grep .go$ | xargs -r rm | |
nix develop -c find . -type f -name .mockery.yaml -execdir mockery \; | |
nix develop -c ./modgraph > go.md | |
git add --all | |
git diff --minimal --cached --exit-code |