ACP-77: Current validators API for SoV #8257
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
name: Tests | |
on: | |
push: | |
tags: | |
- "*" | |
branches: | |
- master | |
- dev | |
pull_request: | |
merge_group: | |
types: [checks_requested] | |
permissions: | |
contents: read | |
# Cancel ongoing workflow runs if a new one is started | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
Unit: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-12, ubuntu-20.04, ubuntu-22.04, windows-2022, custom-arm64-focal, custom-arm64-jammy] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/install-focal-deps | |
if: matrix.os == 'custom-arm64-focal' | |
- uses: ./.github/actions/setup-go-for-project | |
- name: Set timeout on Windows # Windows UT run slower and need a longer timeout | |
shell: bash | |
if: matrix.os == 'windows-2022' | |
run: echo "TIMEOUT=240s" >> "$GITHUB_ENV" | |
- name: build_test | |
shell: bash | |
run: ./scripts/build_test.sh | |
env: | |
TIMEOUT: ${{ env.TIMEOUT }} | |
Fuzz: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go-for-project | |
- name: fuzz_test | |
shell: bash | |
run: ./scripts/build_fuzz.sh 10 # Run each fuzz test 10 seconds | |
e2e_pre_etna: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go-for-project | |
- name: Build AvalancheGo Binary | |
shell: bash | |
run: ./scripts/build.sh -r | |
- name: Run e2e tests | |
uses: ./.github/actions/run-monitored-tmpnet-cmd | |
with: | |
run: E2E_SERIAL=1 ./scripts/tests.e2e.sh --delay-network-shutdown | |
prometheus_id: ${{ secrets.PROMETHEUS_ID || '' }} | |
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} | |
loki_id: ${{ secrets.LOKI_ID || '' }} | |
loki_password: ${{ secrets.LOKI_PASSWORD || '' }} | |
- name: Upload tmpnet network dir | |
uses: ./.github/actions/upload-tmpnet-artifact | |
if: always() | |
with: | |
name: e2e-pre-etna-tmpnet-data | |
e2e_post_etna: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go-for-project | |
- name: Build AvalancheGo Binary | |
shell: bash | |
run: ./scripts/build.sh -r | |
- name: Run e2e tests | |
uses: ./.github/actions/run-monitored-tmpnet-cmd | |
with: | |
run: E2E_SERIAL=1 ./scripts/tests.e2e.sh --delay-network-shutdown --activate-etna | |
prometheus_id: ${{ secrets.PROMETHEUS_ID || '' }} | |
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} | |
loki_id: ${{ secrets.LOKI_ID || '' }} | |
loki_password: ${{ secrets.LOKI_PASSWORD || '' }} | |
- name: Upload tmpnet network dir | |
uses: ./.github/actions/upload-tmpnet-artifact | |
if: always() | |
with: | |
name: e2e-post-etna-tmpnet-data | |
e2e_existing_network: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go-for-project | |
- name: Build AvalancheGo Binary | |
shell: bash | |
run: ./scripts/build.sh -r | |
- name: Run e2e tests with existing network | |
uses: ./.github/actions/run-monitored-tmpnet-cmd | |
with: | |
run: E2E_SERIAL=1 ./scripts/tests.e2e.existing.sh --delay-network-shutdown | |
prometheus_id: ${{ secrets.PROMETHEUS_ID || '' }} | |
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} | |
loki_id: ${{ secrets.LOKI_ID || '' }} | |
loki_password: ${{ secrets.LOKI_PASSWORD || '' }} | |
- name: Upload tmpnet network dir | |
uses: ./.github/actions/upload-tmpnet-artifact | |
if: always() | |
with: | |
name: e2e-existing-network-tmpnet-data | |
Upgrade: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go-for-project | |
- name: Build AvalancheGo Binary | |
shell: bash | |
run: ./scripts/build.sh | |
- name: Run e2e tests | |
uses: ./.github/actions/run-monitored-tmpnet-cmd | |
with: | |
run: ./scripts/tests.upgrade.sh | |
filter_by_owner: avalanchego-e2e | |
prometheus_id: ${{ secrets.PROMETHEUS_ID || '' }} | |
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }} | |
loki_id: ${{ secrets.LOKI_ID || '' }} | |
loki_password: ${{ secrets.LOKI_PASSWORD || '' }} | |
- name: Upload tmpnet network dir | |
uses: ./.github/actions/upload-tmpnet-artifact | |
if: always() | |
with: | |
name: upgrade-tmpnet-data | |
Lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go-for-project | |
- name: Run static analysis tests | |
shell: bash | |
run: scripts/lint.sh | |
- name: Run shellcheck | |
shell: bash | |
run: scripts/shellcheck.sh | |
- name: Run actionlint | |
shell: bash | |
run: scripts/actionlint.sh | |
buf-lint: | |
name: Protobuf Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: bufbuild/buf-setup-action@v1.31.0 | |
with: | |
github_token: ${{ github.token }} | |
- uses: bufbuild/buf-lint-action@v1 | |
with: | |
input: "proto" | |
check_generated_protobuf: | |
name: Up-to-date protobuf | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go-for-project | |
- uses: bufbuild/buf-setup-action@v1.31.0 | |
with: | |
github_token: ${{ github.token }} | |
- shell: bash | |
run: scripts/protobuf_codegen.sh | |
- shell: bash | |
run: .github/workflows/check-clean-branch.sh | |
check_mockgen: | |
name: Up-to-date mocks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go-for-project | |
- shell: bash | |
run: scripts/mock.gen.sh | |
- shell: bash | |
run: .github/workflows/check-clean-branch.sh | |
go_mod_tidy: | |
name: Up-to-date go.mod and go.sum | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go-for-project | |
- shell: bash | |
run: go mod tidy | |
- shell: bash | |
run: .github/workflows/check-clean-branch.sh | |
test_build_image: | |
name: Image build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install qemu (required for cross-platform builds) | |
run: | | |
sudo apt update | |
sudo apt -y install qemu qemu-user-static | |
- name: Check image build | |
shell: bash | |
run: bash -x scripts/tests.build_image.sh | |
test_build_antithesis_avalanchego_images: | |
name: Build Antithesis avalanchego images | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go-for-project | |
- name: Build AvalancheGo Binary | |
shell: bash | |
run: ./scripts/build.sh -r | |
- name: Check that the avalanchego workload is sane | |
shell: bash | |
run: go run ./tests/antithesis/avalanchego --avalanchego-path=./build/avalanchego --duration=60s | |
- name: Check image build for avalanchego test setup | |
shell: bash | |
run: bash -x scripts/tests.build_antithesis_images.sh | |
env: | |
TEST_SETUP: avalanchego | |
test_build_antithesis_xsvm_images: | |
name: Build Antithesis xsvm images | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-go-for-project | |
- name: Build AvalancheGo Binary | |
shell: bash | |
run: ./scripts/build.sh -r | |
- name: Build xsvm binary | |
shell: bash | |
run: ./scripts/build_xsvm.sh | |
- name: Check that the xsvm workload is sane | |
shell: bash | |
run: go run ./tests/antithesis/xsvm --avalanchego-path=./build/avalanchego --duration=60s | |
- name: Check image build for xsvm test setup | |
shell: bash | |
run: bash -x scripts/tests.build_antithesis_images.sh | |
env: | |
TEST_SETUP: xsvm |