Skip to content

Unit tests

Unit tests #9372

Workflow file for this run

name: Unit tests
# Cancel workflow if there is a new change to the branch.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
on:
workflow_dispatch:
merge_group:
pull_request:
branches:
- main
# This needs to be declared explicitly so that the job is actually
# run when moved out of draft.
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- main
schedule:
- cron: "0 0 * * *"
env:
CI: 1
CARGO_INCREMENTAL: 0
CACHE_TIMEOUT_MINUTES: 5
RUSTC_WRAPPER: "sccache"
CC: "sccache clang"
CXX: "sccache clang++"
jobs:
tests:
# Change to `buildjet-8vcpu-ubuntu-2204` if `fuzzy` is down.
# runs-on: fuzzy
runs-on: buildjet-8vcpu-ubuntu-2204
# Run the job only if the PR is not a draft.
# This is done to limit the runner cost.
if: github.event.pull_request.draft == false
timeout-minutes: 30
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.4
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
- uses: actions/setup-go@v5
with:
go-version-file: "src/libp2p_bitswap/tests/go-app/go.mod"
- name: install nextest
uses: taiki-e/install-action@nextest
- run: make test
tests-release:
# Change to `buildjet-8vcpu-ubuntu-2204` if `fuzzy` is down.
# runs-on: fuzzy
runs-on: buildjet-8vcpu-ubuntu-2204
# Run the job only if the PR is not a draft.
# This is done to limit the runner cost.
if: github.event.pull_request.draft == false
timeout-minutes: 30
steps:
# find the nearest S3 space for storing cache files
- name: Show IP
run: curl ifconfig.me
continue-on-error: true
- name: Checkout Sources
uses: actions/checkout@v4
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.4
timeout-minutes: ${{ fromJSON(env.CACHE_TIMEOUT_MINUTES) }}
continue-on-error: true
- uses: actions/setup-go@v5
with:
go-version-file: "src/libp2p_bitswap/tests/go-app/go.mod"
- name: install nextest
uses: taiki-e/install-action@nextest
- run: make test-release