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-31 16:46:48 +00:00
|
|
|
go-version: 1.19
|
2022-10-21 05:49:29 +00:00
|
|
|
check-latest: true
|
2022-03-03 17:07:19 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-12-09 17:14:28 +00:00
|
|
|
- uses: technote-space/get-diff-action@v6.1.2
|
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
|
2023-01-11 15:11:21 +00:00
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
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-31 16:46:48 +00:00
|
|
|
go-version: 1.19
|
2022-10-21 05:49:29 +00:00
|
|
|
check-latest: true
|
2022-03-03 17:07:19 +00:00
|
|
|
- uses: actions/checkout@v3
|
2022-12-09 17:14:28 +00:00
|
|
|
- uses: technote-space/get-diff-action@v6.1.2
|
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
|
2023-01-04 11:04:38 +00:00
|
|
|
|
2022-10-21 05:49:29 +00:00
|
|
|
test-rpc:
|
2020-09-18 16:50:08 +00:00
|
|
|
runs-on: ubuntu-latest
|
2023-01-11 15:44:17 +00:00
|
|
|
timeout-minutes: 30
|
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-31 16:46:48 +00:00
|
|
|
go-version: 1.19
|
2022-10-21 05:49:29 +00:00
|
|
|
check-latest: true
|
|
|
|
- uses: actions/checkout@v3
|
2022-12-09 17:14:28 +00:00
|
|
|
- uses: technote-space/get-diff-action@v6.1.2
|
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
|
|
|
|
2023-01-30 21:59:13 +00:00
|
|
|
sdk_tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Checkout laconic-sdk
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
path: "./laconic-sdk/"
|
|
|
|
repository: cerc-io/laconic-sdk
|
|
|
|
fetch-depth: 0
|
|
|
|
ref: jest_timeout
|
|
|
|
- name: Environment
|
|
|
|
run: ls -tlh && env
|
|
|
|
- name: build containers scripts
|
|
|
|
working-directory: tests/sdk_tests
|
|
|
|
run: ./build-laconicd-container.sh && ./build-sdk-test-container.sh
|
|
|
|
- name: start containers
|
|
|
|
working-directory: tests/sdk_tests
|
|
|
|
run: docker compose up -d
|
|
|
|
- name: run-tests.sh
|
|
|
|
working-directory: tests/sdk_tests
|
2023-02-10 19:44:27 +00:00
|
|
|
run: ./run-tests.sh
|
|
|
|
- name: reset containers for auction tests
|
|
|
|
working-directory: tests/sdk_tests
|
|
|
|
if: always()
|
|
|
|
run: docker compose down
|
|
|
|
- name: start auction containers
|
|
|
|
working-directory: tests/sdk_tests
|
|
|
|
run: docker compose -f docker-compose-auctions.yml up -d
|
|
|
|
- name: run-acution-tests.sh
|
|
|
|
working-directory: tests/sdk_tests
|
|
|
|
run: ./run-auction-tests.sh
|
|
|
|
- name: reset containers for nameservice tests
|
|
|
|
working-directory: tests/sdk_tests
|
|
|
|
if: always()
|
|
|
|
run: docker compose -f docker-compose-auctions.yml down
|
|
|
|
- name: start auction containers
|
|
|
|
working-directory: tests/sdk_tests
|
|
|
|
run: docker compose -f docker-compose-nameservice.yml up -d
|
|
|
|
- name: run-nameservice-expiry-tests.sh
|
|
|
|
working-directory: tests/sdk_tests
|
|
|
|
run: ./run-nameservice-expiry-tests.sh
|
|
|
|
- name: reset containers for nameservice tests
|
|
|
|
working-directory: tests/sdk_tests
|
|
|
|
if: always()
|
|
|
|
run: docker compose -f docker-compose-nameservice.yml down
|