Skip to content

Commit

Permalink
Merge pull request #94 from ava-labs/automated-release
Browse files Browse the repository at this point in the history
Automated release
  • Loading branch information
patrick-ogrady authored May 25, 2022
2 parents 402eac2 + e5c029f commit 7237fa1
Show file tree
Hide file tree
Showing 12 changed files with 835 additions and 293 deletions.
26 changes: 0 additions & 26 deletions .github/workflows/e2e.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/lint-and-tests.yml

This file was deleted.

81 changes: 81 additions & 0 deletions .github/workflows/lint-tests-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
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@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
working-directory: .
args: --timeout 3m

unit_test:
name: Golang Unit Tests v${{ matrix.go }} (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
go: ["1.17"]
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v1
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@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Run e2e tests
shell: bash
run: E2E=true scripts/run.sh 1.7.11 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC

release:
needs: [lint_test, unit_test, e2e_test]
runs-on: ubuntu-latest
steps:
- name: Git checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
# https://docs.github.com/en/actions/security-guides/automatic-token-authentication#about-the-github_token-secret
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ bin/
build/

cmd/simulator/.simulator/*

# goreleaser
dist/
23 changes: 23 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ref. https://goreleaser.com/customization/build/
builds:
- id: subnet-evm
main: ./plugin
binary: subnet-evm
flags:
- -v
ignore:
- goos: darwin
goarch: 386
- goos: linux
goarch: 386
- goos: windows
goarch: 386
- goos: freebsd
goarch: 386

release:
# Repo in which the release will be created.
# Default is extracted from the origin remote URL or empty if its private hosted.
github:
owner: ava-labs
name: subnet-evm
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

![Github Actions](https://github.com/ava-labs/subnet-evm/actions/workflows/lint-tests-release.yml/badge.svg)

# Subnet EVM

[Avalanche](https://docs.avax.network/learn/platform-overview) is a network composed of multiple blockchains.
Expand All @@ -19,6 +22,7 @@ The Subnet EVM runs in a separate process from the main AvalancheGo process and
[v0.1.1-v0.1.2] [email protected]
[v0.2.0] [email protected]
[v0.2.1] [email protected]
[v0.2.2] [email protected]
```

## API
Expand Down Expand Up @@ -50,8 +54,8 @@ To support these changes, there have been a number of changes to the SubnetEVM b

### Block Header

* `BaseFee`: Added by EIP-1559 to represent the base fee of the block (present in Ethereum as of EIP-1559)
* `BlockGasCost`: surcharge for producing a block faster than the target rate
- `BaseFee`: Added by EIP-1559 to represent the base fee of the block (present in Ethereum as of EIP-1559)
- `BlockGasCost`: surcharge for producing a block faster than the target rate


## Run Local Network
Expand All @@ -65,9 +69,9 @@ See [Create an EVM Subnet on Fuji Testnet](https://docs.avax.network/subnets/cre

## Customize a Subnet

* [Genesis](https://docs.avax.network/subnets/customize-a-subnet#genesis)
* [Precompile](https://docs.avax.network/subnets/customize-a-subnet#precompiles)
* [Priority Regossip](https://docs.avax.network/subnets/customize-a-subnet#priority-regossip)
- [Genesis](https://docs.avax.network/subnets/customize-a-subnet#genesis)
- [Precompile](https://docs.avax.network/subnets/customize-a-subnet#precompiles)
- [Priority Regossip](https://docs.avax.network/subnets/customize-a-subnet#priority-regossip)

## Join the WAGMI Subnet Demo

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.17

require (
github.com/VictoriaMetrics/fastcache v1.10.0
github.com/ava-labs/avalanchego v1.7.11-rc.27
github.com/ava-labs/avalanchego v1.7.11
github.com/cespare/cp v0.1.0
github.com/davecgh/go-spew v1.1.1
github.com/deckarep/golang-set v1.8.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0=
github.com/ava-labs/avalanchego v1.7.11-rc.27 h1:GjjGmo1FCcQRsWwVtOxhXLXVczyyriN3wE5uu8nTnYU=
github.com/ava-labs/avalanchego v1.7.11-rc.27/go.mod h1:tbCKLCFYkAm9Q4eaXVhexar9ycJoDNEtwzjlH0PQ82Q=
github.com/ava-labs/avalanchego v1.7.11 h1:tb/dYm85sUm1M0N+2yfwq4dm1X967PKDdjU3lmg7qEs=
github.com/ava-labs/avalanchego v1.7.11/go.mod h1:z/zteB07lMn/xO0aPRJOw80VGuLsn7FRfgbMCd0y4HY=
github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJWl8FwAuQo=
github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y=
github.com/aws/aws-sdk-go-v2/credentials v1.1.1/go.mod h1:mM2iIjwl7LULWtS6JCACyInboHirisUUdkBPoTHMOUo=
Expand Down
8 changes: 4 additions & 4 deletions scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ set -e
# e.g.,
#
# run without e2e tests
# ./scripts/run.sh 1.7.10 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC
# ./scripts/run.sh 1.7.11 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC
#
# run without e2e tests with DEBUG log level
# AVALANCHE_LOG_LEVEL=DEBUG ./scripts/run.sh 1.7.10 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC
# AVALANCHE_LOG_LEVEL=DEBUG ./scripts/run.sh 1.7.11 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC
#
# run with e2e tests
# E2E=true ./scripts/run.sh 1.7.10 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC
# E2E=true ./scripts/run.sh 1.7.11 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC
if ! [[ "$0" =~ scripts/run.sh ]]; then
echo "must be run from repository root"
exit 255
Expand Down Expand Up @@ -191,7 +191,7 @@ EOF
# download avalanche-network-runner
# https://github.com/ava-labs/avalanche-network-runner
# TODO: use "go install -v github.com/ava-labs/avalanche-network-runner/cmd/avalanche-network-runner@v${NETWORK_RUNNER_VERSION}"
NETWORK_RUNNER_VERSION=1.0.12
NETWORK_RUNNER_VERSION=1.0.16
DOWNLOAD_PATH=/tmp/avalanche-network-runner.tar.gz
DOWNLOAD_URL=https://github.com/ava-labs/avalanche-network-runner/releases/download/v${NETWORK_RUNNER_VERSION}/avalanche-network-runner_${NETWORK_RUNNER_VERSION}_linux_amd64.tar.gz
if [[ ${GOOS} == "darwin" ]]; then
Expand Down
12 changes: 6 additions & 6 deletions tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"testing"
"time"

"github.com/ava-labs/avalanche-network-runner/client"
runner_sdk "github.com/ava-labs/avalanche-network-runner-sdk"
"github.com/ava-labs/avalanchego/ids"
ginkgo "github.com/onsi/ginkgo/v2"
"github.com/onsi/ginkgo/v2/formatter"
Expand Down Expand Up @@ -120,15 +120,15 @@ const (
)

var (
cli client.Client
cli runner_sdk.Client
subnetEVMRPCEps []string
)

var _ = ginkgo.BeforeSuite(func() {
gomega.Expect(mode).Should(gomega.Or(gomega.Equal("test"), gomega.Equal("run")))

var err error
cli, err = client.New(client.Config{
cli, err = runner_sdk.New(runner_sdk.Config{
LogLevel: networkRunnerLogLevel,
Endpoint: gRPCEp,
DialTimeout: 10 * time.Second,
Expand All @@ -141,9 +141,9 @@ var _ = ginkgo.BeforeSuite(func() {
resp, err := cli.Start(
ctx,
execPath,
client.WithLogLevel(logLevel),
client.WithPluginDir(pluginDir),
client.WithCustomVMs(map[string]string{
runner_sdk.WithLogLevel(logLevel),
runner_sdk.WithPluginDir(pluginDir),
runner_sdk.WithCustomVMs(map[string]string{
vmName: vmGenesisPath,
}))
cancel()
Expand Down
Loading

0 comments on commit 7237fa1

Please sign in to comment.