Skip to content

Integration tests

Integration tests #6

Workflow file for this run

name: "Integration tests"
on:
workflow_dispatch: # Runs on manual calls
schedule:
- cron: "0 0 * * *" # Runs automatically every day
push:
branches: ["main"]
pull_request:
# Allow concurrent runs on main/release branches but isolates other branches
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: ${{ ! (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) }}
jobs:
heavy-tests:
# Job that runs all tests and publishes code coverage reports.
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v6
- name: "Check for Go-related changes"
id: check_nibiru_go
uses: dorny/paths-filter@v3
with:
filters: |
nibiru-go:
- "app/**/*.go"
- "cmd/**/*.go"
- "eth/**/*.go"
- "gosdk/**/*.go"
- "x/**/*.go"
- "**/*.proto"
- "go.mod"
- "go.sum"
- "contrib/docker-compose/*"
- name: "Set up Go"
if: steps.check_nibiru_go.outputs.nibiru-go == 'true'
uses: actions/setup-go@v6
with:
go-version: 1.24
# cache: "The action has a built-in functionality for caching and
# restoring go modules and build outputs. It uses [actions/cache@v4]."
# - Handles go module cache (go env GOMODCACHE).
# - Handles go build cache (go env GOCACHE).
cache: true
- name: "Install just"
if: steps.check_nibiru_go.outputs.nibiru-go == 'true'
# casey/just: https://just.systems/man/en/chapter_6.html
# taiki-e/install-action: https://github.com/taiki-e/install-action
uses: taiki-e/install-action@just
- name: "Run all heavy tests."
if: steps.check_nibiru_go.outputs.nibiru-go == 'true'
run: just test-cover-heavy
- name: "Merge coverage reports with gocovermerge"
if: steps.check_nibiru_go.outputs.nibiru-go == 'true'
run: |
go install github.com/Unique-Divine/jiyuu/gocovmerge@v0.0.2
gocovmerge -o coverage.out \
coverage.group1.out coverage.group2.out coverage.group3.out
- name: "Upload coverage reports to Codecov"
if: steps.check_nibiru_go.outputs.nibiru-go == 'true'
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
# Docs on usable "with" flags for codecov/codecov-action v5:
# https://github.com/codecov/codecov-action?tab=readme-ov-file#example-workflowyml-with-codecov-action
with:
disable_search: true
files: coverage.out