Skip to content

move syncers to atomic vm (#1009) #1

move syncers to atomic vm (#1009)

move syncers to atomic vm (#1009) #1

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
merge_group:
types: [checks_requested]
workflow_dispatch:
inputs:
avalanchegoRepo:
description: "avalanchego github repository"
required: true
default: "ava-labs/avalanchego"
avalanchegoBranch:
description: "avalanchego branch"
required: true
default: "master"
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: check out ${{ github.event.inputs.avalanchegoRepo }} ${{ github.event.inputs.avalanchegoBranch }}
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.avalanchegoRepo }}
ref: ${{ github.event.inputs.avalanchegoBranch }}
path: avalanchego
token: ${{ secrets.AVALANCHE_PAT }}
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: change avalanchego dep
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
go mod edit -replace github.com/ava-labs/avalanchego=./avalanchego
go mod tidy
go clean -modcache
- run: ./scripts/lint_allowed_eth_imports.sh
shell: bash
- name: Run linters
shell: bash
run: ./scripts/lint.sh
- name: Run shellcheck
shell: bash
run: scripts/shellcheck.sh
- name: Run actionlint
shell: bash
run: scripts/actionlint.sh
- name: Ensure consistent avalanchego version
shell: bash
run: |
./scripts/update_avalanchego_version.sh
git diff --exit-code
test:
name: Golang Unit Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-22.04, ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: check out ${{ github.event.inputs.avalanchegoRepo }} ${{ github.event.inputs.avalanchegoBranch }}
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.avalanchegoRepo }}
ref: ${{ github.event.inputs.avalanchegoBranch }}
path: avalanchego
token: ${{ secrets.AVALANCHE_PAT }}
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: change avalanchego dep
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
go mod edit -replace github.com/ava-labs/avalanchego=./avalanchego
go mod tidy
- name: Set timeout on Windows # Windows UT run slower and need a longer timeout
shell: bash
if: matrix.os == 'windows-latest'
run: echo "TIMEOUT=1200s" >> "$GITHUB_ENV"
- run: go mod download
shell: bash
- name: go mod tidy
run: |
go mod tidy
git diff --exit-code
- name: Mocks are up to date
shell: bash
run: |
grep -lr -E '^// Code generated by MockGen\. DO NOT EDIT\.$' . | xargs -r rm
go generate -run "go.uber.org/mock/mockgen" ./...
git add --intent-to-add --all
git diff --exit-code
- name: fjl/gencodec generated files are up to date
run: |
grep -lr -E '^// Code generated by github\.com\/fjl\/gencodec\. DO NOT EDIT\.$' . | xargs -r rm
go generate -run "github.com/fjl/gencodec" ./...
git add --intent-to-add --all
git diff --exit-code
- run: ./scripts/build.sh evm
shell: bash
- run: ./scripts/build_test.sh
shell: bash
env:
TIMEOUT: ${{ env.TIMEOUT }}
- run: ./scripts/coverage.sh
shell: bash
avalanchego_e2e:
name: AvalancheGo E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: check out ${{ github.event.inputs.avalanchegoRepo }} ${{ github.event.inputs.avalanchegoBranch }}
if: ${{ github.event_name == 'workflow_dispatch' }}
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.avalanchegoRepo }}
ref: ${{ github.event.inputs.avalanchegoBranch }}
path: avalanchego
token: ${{ secrets.AVALANCHE_PAT }}
- uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
- name: Run e2e tests
uses: ava-labs/avalanchego/.github/actions/run-monitored-tmpnet-cmd@86c0b96e8e07347f66d008faac50af1b2d3cecc9
with:
run: ./scripts/tests.e2e.sh
prometheus_username: ${{ secrets.PROMETHEUS_ID || '' }}
prometheus_password: ${{ secrets.PROMETHEUS_PASSWORD || '' }}
loki_username: ${{ secrets.LOKI_ID || '' }}
loki_password: ${{ secrets.LOKI_PASSWORD || '' }}