forked from cerc-io/laconicd-deprecated
cb6715cffb
* build(deps): bump actions/setup-go from 2 to 3 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 2 to 3. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v2...v3) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * Apply suggestions from code review Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
179 lines
4.3 KiB
YAML
179 lines
4.3 KiB
YAML
name: Tests
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
- release/**
|
|
|
|
jobs:
|
|
cleanup-runs:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: rokroskar/workflow-run-cleanup-action@master
|
|
env:
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"
|
|
|
|
install-tparse:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.17
|
|
check-latest: true
|
|
- name: Display Go Version
|
|
run: go version
|
|
- name: Install tparse
|
|
run: |
|
|
export GO111MODULE="on" && go get github.com/mfridman/tparse@latest
|
|
- uses: actions/cache@v3
|
|
with:
|
|
path: ~/go/bin
|
|
key: ${{ runner.os }}-go-tparse-binary
|
|
|
|
test-unit-cover:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.17
|
|
check-latest: true
|
|
- uses: actions/checkout@v3
|
|
- uses: technote-space/get-diff-action@v6.0.1
|
|
with:
|
|
PATTERNS: |
|
|
**/**.sol
|
|
**/**.go
|
|
go.mod
|
|
go.sum
|
|
- name: Test and Create Coverage Report
|
|
run: |
|
|
make test-unit-cover
|
|
if: env.GIT_DIFF
|
|
- uses: codecov/codecov-action@v3
|
|
with:
|
|
file: ./coverage.txt
|
|
fail_ci_if_error: true
|
|
if: env.GIT_DIFF
|
|
|
|
test-importer:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.17
|
|
check-latest: true
|
|
- uses: actions/checkout@v3
|
|
- uses: technote-space/get-diff-action@v6.0.1
|
|
id: git_diff
|
|
with:
|
|
SUFFIX_FILTER: |
|
|
.go
|
|
.mod
|
|
.sum
|
|
- name: test-importer
|
|
run: |
|
|
make test-import
|
|
if: env.GIT_DIFF
|
|
|
|
test-solidity:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 240
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
batch: ['1-3', '2-3', '3-3']
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.17
|
|
check-latest: true
|
|
- uses: technote-space/get-diff-action@v6.0.1
|
|
id: git_diff
|
|
with:
|
|
PATTERNS: |
|
|
**/**.sol
|
|
**/**.go
|
|
tests/solidity/**/*.js
|
|
tests/solidity/**/*.sh
|
|
go.mod
|
|
go.sum
|
|
- name: test-solidity
|
|
run: |
|
|
./scripts/run-solidity-tests.sh --batch=${{ matrix.batch }}
|
|
if: env.GIT_DIFF
|
|
|
|
liveness-test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.17
|
|
check-latest: true
|
|
- uses: technote-space/get-diff-action@v6.0.1
|
|
id: git_diff
|
|
with:
|
|
PATTERNS: |
|
|
**/**.go
|
|
go.mod
|
|
go.sum
|
|
- name: Install Starport
|
|
run: |
|
|
curl https://get.starport.network/starport! | bash
|
|
if: env.GIT_DIFF
|
|
- name: Start Local Network via Starport
|
|
run: |
|
|
starport chain serve --reset-once -v -c ./starport.yml > starport.out 2>&1 &
|
|
if: env.GIT_DIFF
|
|
- name: Test Local Network Liveness
|
|
run: |
|
|
sleep 2m
|
|
./contrib/scripts/test_localnet_liveness.sh 100 5 50 localhost
|
|
if: env.GIT_DIFF
|
|
|
|
test-rpc:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.17
|
|
check-latest: true
|
|
- uses: actions/checkout@v3
|
|
- uses: technote-space/get-diff-action@v6.0.1
|
|
with:
|
|
PATTERNS: |
|
|
**/**.sol
|
|
**/**.go
|
|
go.mod
|
|
go.sum
|
|
- name: Test rpc endpoint
|
|
run: |
|
|
make test-rpc
|
|
if: env.GIT_DIFF
|
|
|
|
test-e2e:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.17
|
|
check-latest: true
|
|
- uses: actions/checkout@v3
|
|
- uses: technote-space/get-diff-action@v6.0.1
|
|
with:
|
|
PATTERNS: |
|
|
**/**.sol
|
|
**/**.go
|
|
go.mod
|
|
go.sum
|
|
- name: Test e2e
|
|
run: |
|
|
make test-integration
|
|
if: env.GIT_DIFF |