forked from cerc-io/laconicd-deprecated
131 lines
3.7 KiB
YAML
131 lines
3.7 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'"
|
|
|
|
test-unit-cover:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.19
|
|
check-latest: true
|
|
- uses: actions/checkout@v3
|
|
- uses: technote-space/get-diff-action@v6.1.2
|
|
with:
|
|
PATTERNS: |
|
|
**/**.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
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
if: env.GIT_DIFF
|
|
|
|
test-importer:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.19
|
|
check-latest: true
|
|
- uses: actions/checkout@v3
|
|
- uses: technote-space/get-diff-action@v6.1.2
|
|
id: git_diff
|
|
with:
|
|
PATTERNS: |
|
|
**/**.go
|
|
go.mod
|
|
go.sum
|
|
- name: test-importer
|
|
run: |
|
|
make test-import
|
|
if: env.GIT_DIFF
|
|
|
|
test-rpc:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/setup-go@v3
|
|
with:
|
|
go-version: 1.19
|
|
check-latest: true
|
|
- uses: actions/checkout@v3
|
|
- uses: technote-space/get-diff-action@v6.1.2
|
|
with:
|
|
PATTERNS: |
|
|
**/**.sol
|
|
**/**.go
|
|
go.mod
|
|
go.sum
|
|
- name: Test rpc endpoint
|
|
run: |
|
|
make test-rpc
|
|
if: env.GIT_DIFF
|
|
|
|
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
|
|
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
|