Skip to content

chore: pin GitHub Actions to commit SHAs #1

chore: pin GitHub Actions to commit SHAs

chore: pin GitHub Actions to commit SHAs #1

name: Build + test + release
on:
push:
branches:
- master
tags:
- "*"
pull_request:
jobs:
lint_test:
name: Lint
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- run: ./scripts/lint_allowed_geth_imports.sh
shell: bash
- name: golangci-lint
uses: golangci/golangci-lint-action@5c56cd6c9dc07901af25baab6f2b0d9f3b7c3018 # v2
with:
version: v1.47
working-directory: .
args: --timeout 3m
unit_test:
name: Golang Unit Tests v${{ matrix.go }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.18"]
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
- uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3
with:
go-version: ${{ matrix.go }}
- run: go mod download
shell: bash
- run: ./scripts/build.sh ./build/subnetevm
shell: bash
- run: ./scripts/build_test.sh -race
shell: bash
- run: ./scripts/coverage.sh
shell: bash
e2e_test:
name: e2e tests
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3
with:
go-version: 1.18
- name: Use Node.js
uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3
with:
node-version: "14.x"
- name: Yarn install
run: yarn
working-directory: ./contract-examples
- name: Run e2e tests
shell: bash
run: SKIP_NETWORK_RUNNER_START=true SKIP_NETWORK_RUNNER_SHUTDOWN=true ENABLE_SOLIDITY_TESTS=true scripts/run.sh
simulator_test:
name: Load testing with simulator
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3
with:
go-version: 1.18
- name: Run simulator tests
shell: bash
run: SKIP_NETWORK_RUNNER_SHUTDOWN=true RUN_SIMULATOR=true scripts/run.sh
release:
# needs: [lint_test, simulator_test] # TODO: re-add after flaky tests are fixed (unit_test, e2e_test)
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3
with:
fetch-depth: 0
path: subnet-evm
- name: Set up Go
uses: actions/setup-go@be3c94b385c4f180051c996d336f57a34c397495 # v3
with:
go-version: 1.18
- name: Set up arm64 cross compiler
run: sudo apt-get -y install gcc-aarch64-linux-gnu
- name: Checkout osxcross
uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2
with:
repository: tpoechtrager/osxcross
path: osxcross
- name: Build osxcross
run: |
sudo apt-get -y install clang llvm-dev libxml2-dev uuid-dev libssl-dev bash patch make tar xz-utils bzip2 gzip sed cpio libbz2-dev
cd osxcross
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz -O tarballs/MacOSX11.3.sdk.tar.xz
echo cd4f08a75577145b8f05245a2975f7c81401d75e9535dcffbb879ee1deefcbf4 tarballs/MacOSX11.3.sdk.tar.xz | sha256sum -c -
UNATTENDED=1 ./build.sh
echo $PWD/target/bin >> $GITHUB_PATH
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@b953231f81b8dfd023c58e0854a721e35037f28b # v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
workdir: ./subnet-evm/
env:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}