Go tests CI triggered from @gligneul of gligneul/blob-fix-3.7 #18821
Workflow file for this run
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: Go tests CI | |
run-name: Go tests CI triggered from @${{ github.actor }} of ${{ github.head_ref }} | |
on: | |
workflow_dispatch: | |
merge_group: | |
pull_request: | |
push: | |
branches: | |
- master | |
- develop | |
jobs: | |
test: | |
name: Go Tests | |
runs-on: arbitrator-ci | |
# Creates a redis container for redis tests | |
services: | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
strategy: | |
fail-fast: false | |
matrix: | |
test-mode: [defaults, pathdb, challenge, stylus, l3challenge] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
with: | |
submodules: true | |
- name: Install dependencies | |
run: sudo apt update && sudo apt install -y wabt gotestsum | |
- name: Setup nodejs | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '24' | |
cache: 'yarn' | |
cache-dependency-path: '**/yarn.lock' | |
- name: Install go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.24.x | |
- name: Install wasm-ld | |
run: | | |
sudo apt-get update && sudo apt-get install -y lld-14 | |
sudo ln -s /usr/bin/wasm-ld-14 /usr/local/bin/wasm-ld | |
- name: Install rust stable | |
uses: dtolnay/rust-toolchain@stable | |
id: install-rust | |
with: | |
toolchain: '1.84.1' | |
targets: 'wasm32-wasip1, wasm32-unknown-unknown' | |
components: 'llvm-tools-preview, rustfmt, clippy' | |
- name: Install rust nightly | |
uses: dtolnay/rust-toolchain@nightly | |
id: install-rust-nightly | |
with: | |
toolchain: 'nightly-2025-02-14' | |
targets: 'wasm32-wasip1, wasm32-unknown-unknown' | |
components: 'rust-src, rustfmt, clippy' | |
- name: Set STYLUS_NIGHTLY_VER environment variable | |
run: echo "STYLUS_NIGHTLY_VER=+$(rustup toolchain list | grep '^nightly' | head -n1 | cut -d' ' -f1)" >> "$GITHUB_ENV" | |
- name: Get Rust version | |
id: rust-version | |
run: echo "version=$(rustc --version | cut -d' ' -f2)" >> $GITHUB_OUTPUT | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@v1 | |
with: | |
cache: false | |
version: v1.0.0 | |
- name: Install cbindgen | |
run: cargo install --force cbindgen | |
- name: Cache Build Products | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/go-build | |
key: ${{ runner.os }}-go-${{ matrix.test-mode }}-${{ hashFiles('**/go.sum') }} | |
restore-keys: ${{ runner.os }}-go-${{ matrix.test-mode }}- | |
- name: Cache Rust Build Products | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/ | |
arbitrator/target/ | |
arbitrator/wasm-libraries/target/ | |
arbitrator/wasm-libraries/soft-float/ | |
target/etc/initial-machine-cache/ | |
/home/runner/.rustup/toolchains/ | |
key: ${{ runner.os }}-cargo-${{ matrix.test-mode }}-${{ steps.rust-version.outputs.version }}-min-${{ hashFiles('arbitrator/Cargo.lock') }} | |
restore-keys: ${{ runner.os }}-cargo-${{ matrix.test-mode }}-${{ steps.rust-version.outputs.version }}- | |
- name: Cache cbrotli | |
uses: actions/cache@v4 | |
id: cache-cbrotli | |
with: | |
path: | | |
target/include/brotli/ | |
target/lib-wasm/ | |
target/lib/libbrotlicommon-static.a | |
target/lib/libbrotlienc-static.a | |
target/lib/libbrotlidec-static.a | |
key: ${{ runner.os }}-brotli-${{ matrix.test-mode }}-${{ hashFiles('scripts/build-brotli.sh') }}-${{ hashFiles('.github/workflows/arbitrator-ci.yml') }} | |
- name: Build cbrotli-local | |
if: steps.cache-cbrotli.outputs.cache-hit != 'true' | |
run: ./scripts/build-brotli.sh -l | |
- name: Build cbrotli-wasm in docker | |
if: steps.cache-cbrotli.outputs.cache-hit != 'true' | |
run: ./scripts/build-brotli.sh -w -d | |
- name: Build | |
run: make build test-go-deps -j8 | |
- name: Build all lint dependencies | |
run: make -j8 build-node-deps | |
- name: Lint | |
uses: golangci/golangci-lint-action@v8 | |
with: | |
version: latest | |
skip-cache: true | |
skip-save-cache: true | |
- name: Custom Lint | |
run: | | |
go run ./linters ./... | |
- name: Set environment variables | |
run: | | |
mkdir -p target/tmp/deadbeefbee | |
echo "TMPDIR=$(pwd)/target/tmp/deadbeefbee" >> "$GITHUB_ENV" | |
echo "GOMEMLIMIT=6GiB" >> "$GITHUB_ENV" | |
echo "GOGC=80" >> "$GITHUB_ENV" | |
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> "$GITHUB_ENV" | |
- name: run tests without race detection and path state scheme | |
if: matrix.test-mode == 'pathdb' | |
run: | | |
echo "Running tests with Path Scheme" >> full.log | |
${{ github.workspace }}/.github/workflows/gotestsum.sh --tags cionly --timeout 90m --cover --test_state_scheme path | |
- name: run tests without race detection and hash state scheme | |
if: matrix.test-mode == 'defaults' | |
run: | | |
echo "Running tests with Hash Scheme" >> full.log | |
${{ github.workspace }}/.github/workflows/gotestsum.sh --tags cionly --timeout 60m --test_state_scheme hash | |
- name: run redis tests | |
if: matrix.test-mode == 'defaults' | |
run: | | |
echo "Running redis tests" >> full.log | |
gotestsum --format short-verbose -- -p 1 -run TestRedis ./arbnode/... ./system_tests/... -coverprofile=coverage-redis.txt -covermode=atomic -coverpkg=./... -- --test_redis=redis://localhost:6379/0 | |
- name: create block input json file | |
if: matrix.test-mode == 'defaults' | |
run: | | |
gotestsum --format short-verbose -- -run TestProgramStorage$ ./system_tests/... --count 1 -- --recordBlockInputs.enable=true --recordBlockInputs.WithBaseDir="${{ github.workspace }}/target" --recordBlockInputs.WithTimestampDirEnabled=false --recordBlockInputs.WithBlockIdInFileNameEnabled=false | |
- name: run arbitrator prover on block input json | |
if: matrix.test-mode == 'defaults' | |
run: | | |
make build-prover-bin | |
target/bin/prover target/machines/latest/machine.wavm.br -b --json-inputs="${{ github.workspace }}/target/TestProgramStorage/block_inputs.json" | |
- name: run jit prover on block input json | |
if: matrix.test-mode == 'defaults' | |
run: | | |
make build-jit | |
if [ -n "$(target/bin/jit --binary target/machines/latest/replay.wasm --cranelift --json-inputs='${{ github.workspace }}/target/TestProgramStorage/block_inputs.json')" ]; then | |
echo "Error: Command produced output." | |
exit 1 | |
fi | |
- name: build challenge tests | |
if: matrix.test-mode == 'challenge' | |
run: | | |
go test -tags challengetest ./... -run=^$ -v | |
- name: run L3 challenge tests | |
if: matrix.test-mode == 'l3challenge' | |
run: ${{ github.workspace }}/.github/workflows/gotestsum.sh --tags challengetest --run TestL3Challenge --timeout 120m --cover | |
- name: run stylus tests | |
if: matrix.test-mode == 'stylus' | |
run: ${{ github.workspace }}/.github/workflows/gotestsum.sh --tags stylustest --run TestProgramArbitrator --timeout 60m --cover | |
- name: Archive detailed run log | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.test-mode }}-full.log | |
path: full.log | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v5 | |
if: matrix.test-mode == 'defaults' | |
with: | |
fail_ci_if_error: false | |
files: ./coverage.txt,./coverage-redis.txt | |
verbose: false | |
token: ${{ secrets.CODECOV_TOKEN }} |