2025-10-08 05:23:52 +02:00

59 lines
1.4 KiB
YAML

name: Go Tests
on:
push:
branches: master
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build libcodex
if: steps.cache-libcodex.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake curl git rustc cargo
cargo --version
make update
make libcodex
- name: Record submodule commit
run: git -C vendor/nim-codex rev-parse HEAD > vendor/nim-codex/.codex-commit
- name: Cache libcodex build
id: cache-libcodex
uses: actions/cache@v4
with:
path: vendor/nim-codex/build
key: ${{ runner.os }}-libcodex-${{ hashFiles('vendor/nim-codex/.codex-commit') }}
- name: Build libcodex
if: steps.cache-libcodex.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake curl git rustc cargo
make update
CODEX_LIB_PARAMS="-d:codex_enable_api_debug_peers=true" make libcodex
- name: Build codex go
run: |
cd codex
go build -o codex-go
- name: Go test
env:
CGO_ENABLED: 1
run: go test ./...