Skip to content

Commit 7f6cade

Browse files
committed
Separate CI and release
1 parent 98e4221 commit 7f6cade

File tree

2 files changed

+133
-0
lines changed

2 files changed

+133
-0
lines changed

.github/workflows/ci.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Build + Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- 'v[0-9]+.[0-9]+.[0-9]+'
9+
pull_request:
10+
11+
jobs:
12+
lint_test:
13+
name: Lint
14+
runs-on: ubuntu-20.04
15+
steps:
16+
- uses: actions/checkout@v3
17+
- run: ./scripts/lint_allowed_geth_imports.sh
18+
shell: bash
19+
- uses: actions/setup-go@v3
20+
with:
21+
go-version: "1.19"
22+
- name: golangci-lint
23+
uses: golangci/golangci-lint-action@v3
24+
with:
25+
version: v1.51
26+
working-directory: .
27+
args: --timeout 3m
28+
29+
unit_test:
30+
name: Golang Unit Tests
31+
runs-on: ubuntu-20.04
32+
steps:
33+
- uses: actions/checkout@v3
34+
- uses: actions/setup-go@v3
35+
with:
36+
go-version: "1.19"
37+
- run: go mod download
38+
shell: bash
39+
- run: ./scripts/build.sh ./build/subnetevm
40+
shell: bash
41+
- run: ./scripts/build_test.sh -race
42+
shell: bash
43+
- run: ./scripts/coverage.sh
44+
shell: bash
45+
46+
build_image:
47+
name: Build Docker Image
48+
runs-on: ubuntu-20.04
49+
steps:
50+
- uses: actions/checkout@v3
51+
- run: echo ${{ secrets.docker_pass }} | docker login --username ${{ secrets.docker_username }} --password-stdin
52+
shell: bash
53+
- run: export BUILD_IMAGE_ID=${{ github.ref_name }}
54+
shell: bash
55+
- run: PUSH_DOCKER_IMAGE=true ./scripts/build_image.sh
56+
shell: bash
57+
58+
e2e_test:
59+
name: e2e tests
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Git checkout
63+
uses: actions/checkout@v3
64+
with:
65+
fetch-depth: 0
66+
- name: Set up Go
67+
uses: actions/setup-go@v3
68+
with:
69+
go-version: "1.19"
70+
- name: Use Node.js
71+
uses: actions/setup-node@v3
72+
with:
73+
node-version: "14.x"
74+
- name: Yarn install
75+
run: yarn
76+
working-directory: ./contract-examples
77+
- name: Install AvalancheGo Release
78+
shell: bash
79+
run: BASEDIR=/tmp/e2e-test AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego ./scripts/install_avalanchego_release.sh
80+
- name: Build Subnet-EVM Plugin Binary
81+
shell: bash
82+
run: ./scripts/build.sh /tmp/e2e-test/avalanchego/plugins/srEXiWaHuhNyGwPUi444Tu47ZEDwxTWrbQiuD7FmgSAQ6X7Dy
83+
- name: Run E2E Tests
84+
shell: bash
85+
run: AVALANCHEGO_BUILD_PATH=/tmp/e2e-test/avalanchego DATA_DIR=/tmp/e2e-test/data ./scripts/run_ginkgo.sh

.github/workflows/release.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
8+
jobs:
9+
release:
10+
# needs: [lint_test, unit_test, e2e_test, simulator_test]
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- name: Git checkout
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
path: subnet-evm
18+
- name: Set up Go
19+
uses: actions/setup-go@v3
20+
with:
21+
go-version: "1.19"
22+
- name: Set up arm64 cross compiler
23+
run: |
24+
sudo apt-get -y update
25+
sudo apt-get -y install gcc-aarch64-linux-gnu
26+
- name: Checkout osxcross
27+
uses: actions/checkout@v2
28+
with:
29+
repository: tpoechtrager/osxcross
30+
path: osxcross
31+
- name: Build osxcross
32+
run: |
33+
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
34+
cd osxcross
35+
wget https://github.com/phracker/MacOSX-SDKs/releases/download/11.3/MacOSX11.3.sdk.tar.xz -O tarballs/MacOSX11.3.sdk.tar.xz
36+
echo cd4f08a75577145b8f05245a2975f7c81401d75e9535dcffbb879ee1deefcbf4 tarballs/MacOSX11.3.sdk.tar.xz | sha256sum -c -
37+
UNATTENDED=1 ./build.sh
38+
echo $PWD/target/bin >> $GITHUB_PATH
39+
- name: Run GoReleaser
40+
uses: goreleaser/goreleaser-action@v2
41+
with:
42+
distribution: goreleaser
43+
version: latest
44+
args: release --clean
45+
workdir: ./subnet-evm/
46+
env:
47+
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)