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:
- 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
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
file: ./coverage.txt
fail_ci_if_error: true
test-importer:
timeout-minutes: 10
id: git_diff
- name: test-importer
make test-import
test-rpc:
timeout-minutes: 15
**/**.sol
- name: Test rpc endpoint
make test-rpc
sdk_tests:
- name: Checkout laconic-sdk
uses: actions/checkout@v3
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
run: docker compose up -d
- name: run-tests.sh
run: ./run-tests.sh
# integration_tests:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: cachix/install-nix-action@v18
# - uses: cachix/cachix-action@v12
# with:
# name: ethermint
# signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
# - uses: technote-space/get-diff-action@v6.1.2
# 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
# name: debug-files
# path: debug_files.tar.gz
# if-no-files-found: ignore
# upload-cache:
# if: github.event_name == 'push'
# needs: ["integration_tests"]
# strategy:
# matrix:
# os: [macos-latest]
# runs-on: ${{ matrix.os }}
# - name: 'instantiate integration test env'
# run: nix-store -r "$(nix-instantiate tests/integration_tests/shell.nix)"