2021-08-26 15:21:43 +00:00
|
|
|
name: Tests
|
2020-06-26 22:26:55 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
2021-06-09 08:11:23 +00:00
|
|
|
- main
|
2021-08-26 15:21:43 +00:00
|
|
|
- release/**
|
2020-06-26 22:26:55 +00:00
|
|
|
|
2021-08-26 15:21:43 +00:00
|
|
|
jobs:
|
|
|
|
cleanup-runs:
|
2020-06-26 22:26:55 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-08-26 15:21:43 +00:00
|
|
|
- uses: rokroskar/workflow-run-cleanup-action@master
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
|
|
|
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"
|
2020-06-26 22:26:55 +00:00
|
|
|
|
2021-08-26 15:21:43 +00:00
|
|
|
test-unit-cover:
|
2020-06-26 22:26:55 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-10-21 05:49:29 +00:00
|
|
|
- uses: actions/setup-go@v3
|
2021-04-17 10:00:07 +00:00
|
|
|
with:
|
2022-10-04 18:21:32 +00:00
|
|
|
go-version: 1.18
|
2022-10-21 05:49:29 +00:00
|
|
|
check-latest: true
|
2022-03-03 17:07:19 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-10-21 05:49:29 +00:00
|
|
|
- uses: technote-space/get-diff-action@v6.1.1
|
2020-06-26 22:26:55 +00:00
|
|
|
with:
|
2021-08-26 15:21:43 +00:00
|
|
|
PATTERNS: |
|
|
|
|
**/**.go
|
|
|
|
go.mod
|
|
|
|
go.sum
|
|
|
|
- name: Test and Create Coverage Report
|
2020-06-26 22:26:55 +00:00
|
|
|
run: |
|
2021-08-26 15:21:43 +00:00
|
|
|
make test-unit-cover
|
|
|
|
if: env.GIT_DIFF
|
2022-10-21 05:49:29 +00:00
|
|
|
- uses: codecov/codecov-action@v3
|
2020-06-26 22:26:55 +00:00
|
|
|
with:
|
|
|
|
file: ./coverage.txt
|
|
|
|
fail_ci_if_error: true
|
2021-08-26 15:21:43 +00:00
|
|
|
if: env.GIT_DIFF
|
2020-07-24 18:54:25 +00:00
|
|
|
|
2021-10-22 10:20:23 +00:00
|
|
|
test-importer:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 10
|
|
|
|
steps:
|
2022-10-21 05:49:29 +00:00
|
|
|
- uses: actions/setup-go@v3
|
2021-10-22 10:20:23 +00:00
|
|
|
with:
|
2022-10-04 18:21:32 +00:00
|
|
|
go-version: 1.18
|
2022-10-21 05:49:29 +00:00
|
|
|
check-latest: true
|
2022-03-03 17:07:19 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-10-21 05:49:29 +00:00
|
|
|
- uses: technote-space/get-diff-action@v6.1.1
|
2021-10-22 10:20:23 +00:00
|
|
|
id: git_diff
|
|
|
|
with:
|
2022-10-21 05:49:29 +00:00
|
|
|
PATTERNS: |
|
|
|
|
**/**.go
|
|
|
|
go.mod
|
|
|
|
go.sum
|
2021-10-22 10:20:23 +00:00
|
|
|
- name: test-importer
|
|
|
|
run: |
|
|
|
|
make test-import
|
2022-02-09 13:56:12 +00:00
|
|
|
if: env.GIT_DIFF
|
2022-10-21 05:49:29 +00:00
|
|
|
|
|
|
|
test-rpc:
|
2020-09-18 16:50:08 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-10-21 05:49:29 +00:00
|
|
|
timeout-minutes: 15
|
2020-09-18 16:50:08 +00:00
|
|
|
steps:
|
2022-10-21 05:49:29 +00:00
|
|
|
- uses: actions/setup-go@v3
|
2021-10-20 19:00:17 +00:00
|
|
|
with:
|
2022-10-04 18:21:32 +00:00
|
|
|
go-version: 1.18
|
2022-10-21 05:49:29 +00:00
|
|
|
check-latest: true
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: technote-space/get-diff-action@v6.1.1
|
2020-09-18 16:50:08 +00:00
|
|
|
with:
|
2021-09-07 07:54:53 +00:00
|
|
|
PATTERNS: |
|
|
|
|
**/**.sol
|
|
|
|
**/**.go
|
|
|
|
go.mod
|
|
|
|
go.sum
|
2022-10-21 05:49:29 +00:00
|
|
|
- name: Test rpc endpoint
|
2020-09-18 16:50:08 +00:00
|
|
|
run: |
|
2022-10-21 05:49:29 +00:00
|
|
|
make test-rpc
|
2022-02-09 13:56:12 +00:00
|
|
|
if: env.GIT_DIFF
|
2021-08-26 15:21:43 +00:00
|
|
|
|
2022-10-21 05:49:29 +00:00
|
|
|
test-e2e:
|
2021-08-26 15:21:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-10-21 05:49:29 +00:00
|
|
|
timeout-minutes: 15
|
2021-08-26 15:21:43 +00:00
|
|
|
steps:
|
2022-10-21 05:49:29 +00:00
|
|
|
- uses: actions/setup-go@v3
|
2021-08-26 15:21:43 +00:00
|
|
|
with:
|
2022-10-04 18:21:32 +00:00
|
|
|
go-version: 1.18
|
2022-10-21 05:49:29 +00:00
|
|
|
check-latest: true
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: technote-space/get-diff-action@v6.1.1
|
2021-08-26 15:21:43 +00:00
|
|
|
with:
|
|
|
|
PATTERNS: |
|
2022-10-21 05:49:29 +00:00
|
|
|
**/**.sol
|
2021-08-26 15:21:43 +00:00
|
|
|
**/**.go
|
|
|
|
go.mod
|
|
|
|
go.sum
|
2022-10-21 05:49:29 +00:00
|
|
|
- name: Test e2e
|
2021-08-26 15:21:43 +00:00
|
|
|
run: |
|
2022-10-21 05:49:29 +00:00
|
|
|
make test-integration
|
2021-08-26 15:21:43 +00:00
|
|
|
if: env.GIT_DIFF
|
2022-10-21 05:49:29 +00:00
|
|
|
|
2022-10-27 09:19:15 +00:00
|
|
|
# integration_tests:
|
|
|
|
# runs-on: ubuntu-latest
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v2
|
|
|
|
# - uses: cachix/install-nix-action@v18
|
|
|
|
# - uses: cachix/cachix-action@v11
|
|
|
|
# with:
|
|
|
|
# name: ethermint
|
|
|
|
# signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
|
|
|
|
# - uses: technote-space/get-diff-action@v6.1.1
|
|
|
|
# with:
|
|
|
|
# PATTERNS: |
|
|
|
|
# **/**.sol
|
|
|
|
# **/**.go
|
|
|
|
# go.mod
|
|
|
|
# go.sum
|
|
|
|
# tests/integration_tests/**
|
|
|
|
# - name: Run integration tests
|
|
|
|
# run: make run-integration-tests
|
|
|
|
# if: env.GIT_DIFF
|
|
|
|
# - name: 'Tar debug files'
|
|
|
|
# if: failure()
|
|
|
|
# run: tar cfz debug_files.tar.gz -C /tmp/pytest-of-runner .
|
|
|
|
# - uses: actions/upload-artifact@v3
|
|
|
|
# if: failure()
|
|
|
|
# with:
|
|
|
|
# name: debug-files
|
|
|
|
# path: debug_files.tar.gz
|
|
|
|
# if-no-files-found: ignore
|
2022-10-21 05:49:29 +00:00
|
|
|
|
2022-11-15 06:21:14 +00:00
|
|
|
# upload-cache:
|
|
|
|
# if: github.event_name == 'push'
|
|
|
|
# needs: ["integration_tests"]
|
|
|
|
# strategy:
|
|
|
|
# matrix:
|
|
|
|
# os: [macos-latest]
|
|
|
|
# runs-on: ${{ matrix.os }}
|
|
|
|
# steps:
|
|
|
|
# - uses: actions/checkout@v2
|
|
|
|
# - uses: cachix/install-nix-action@v18
|
|
|
|
# - uses: cachix/cachix-action@v11
|
|
|
|
# with:
|
|
|
|
# name: ethermint
|
|
|
|
# signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
|
|
|
|
# - name: 'instantiate integration test env'
|
|
|
|
# run: nix-store -r $(nix-instantiate tests/integration_tests/shell.nix)
|
2022-10-21 05:49:29 +00:00
|
|
|
|
|
|
|
test-sim-nondeterminism:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 25
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: 1.18
|
|
|
|
check-latest: true
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: technote-space/get-diff-action@v6.1.1
|
|
|
|
with:
|
|
|
|
PATTERNS: |
|
|
|
|
**/**.go
|
|
|
|
go.mod
|
|
|
|
go.sum
|
|
|
|
- name: Test simulation nondeterminism
|
2021-08-26 15:21:43 +00:00
|
|
|
run: |
|
2022-10-21 05:49:29 +00:00
|
|
|
make test-sim-nondeterminism
|
2021-08-26 15:21:43 +00:00
|
|
|
if: env.GIT_DIFF
|
2022-10-21 05:49:29 +00:00
|
|
|
|
|
|
|
test-sim-random-genesis-fast:
|
2021-10-07 16:41:27 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-10-21 05:49:29 +00:00
|
|
|
timeout-minutes: 25
|
2021-10-07 16:41:27 +00:00
|
|
|
steps:
|
2022-10-21 05:49:29 +00:00
|
|
|
- uses: actions/setup-go@v3
|
2021-10-07 16:41:27 +00:00
|
|
|
with:
|
2022-10-04 18:21:32 +00:00
|
|
|
go-version: 1.18
|
2022-10-21 05:49:29 +00:00
|
|
|
check-latest: true
|
2022-03-03 17:07:19 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-10-21 05:49:29 +00:00
|
|
|
- uses: technote-space/get-diff-action@v6.1.1
|
2021-10-07 16:41:27 +00:00
|
|
|
with:
|
|
|
|
PATTERNS: |
|
|
|
|
**/**.go
|
|
|
|
go.mod
|
|
|
|
go.sum
|
2022-10-21 05:49:29 +00:00
|
|
|
- name: Test simulation with random genesis
|
2021-10-07 16:41:27 +00:00
|
|
|
run: |
|
2022-10-21 05:49:29 +00:00
|
|
|
make test-sim-random-genesis-fast
|
2021-10-07 16:41:27 +00:00
|
|
|
if: env.GIT_DIFF
|
2022-02-09 13:56:12 +00:00
|
|
|
|
2022-10-21 05:49:29 +00:00
|
|
|
test-sim-import-export:
|
2022-02-09 13:56:12 +00:00
|
|
|
runs-on: ubuntu-latest
|
2022-10-21 05:49:29 +00:00
|
|
|
timeout-minutes: 25
|
2022-02-09 13:56:12 +00:00
|
|
|
steps:
|
2022-10-21 05:49:29 +00:00
|
|
|
- uses: actions/setup-go@v3
|
2022-02-09 13:56:12 +00:00
|
|
|
with:
|
2022-10-04 18:21:32 +00:00
|
|
|
go-version: 1.18
|
2022-10-21 05:49:29 +00:00
|
|
|
check-latest: true
|
2022-03-03 17:07:19 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-10-21 05:49:29 +00:00
|
|
|
- uses: technote-space/get-diff-action@v6.1.1
|
2022-02-09 13:56:12 +00:00
|
|
|
with:
|
|
|
|
PATTERNS: |
|
|
|
|
**/**.go
|
|
|
|
go.mod
|
|
|
|
go.sum
|
2022-10-21 05:49:29 +00:00
|
|
|
- name: Simulation of import and export genesis
|
2022-02-09 13:56:12 +00:00
|
|
|
run: |
|
2022-10-21 05:49:29 +00:00
|
|
|
make test-sim-import-export
|
2022-10-04 18:21:32 +00:00
|
|
|
if: env.GIT_DIFF
|
2022-10-21 05:49:29 +00:00
|
|
|
|
|
|
|
test-sim-after-import:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
timeout-minutes: 25
|
|
|
|
steps:
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
with:
|
|
|
|
go-version: 1.18
|
|
|
|
check-latest: true
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: technote-space/get-diff-action@v6.1.1
|
|
|
|
with:
|
|
|
|
PATTERNS: |
|
|
|
|
**/**.go
|
|
|
|
go.mod
|
|
|
|
go.sum
|
|
|
|
- name: Test simulation after import
|
|
|
|
run: |
|
|
|
|
make test-sim-after-import
|
|
|
|
if: env.GIT_DIFF
|