Skip to content

CI

CI #362

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
schedule:
- cron: '0 */6 * * *' # Every 6 hours - catch tempo drift early
workflow_dispatch: # Manual trigger
jobs:
test:
name: Test (Go ${{ matrix.go-version }})
runs-on: ubuntu-latest
strategy:
matrix:
go-version: ['1.24', '1.25', '1.26']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go-version }}-
- name: Download dependencies
run: go mod download
- name: Run checks and tests
run: make check
- name: Build examples
run: make build_examples
integration-localnet:
name: Integration Tests (Localnet)
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Download dependencies
run: go mod download
- name: Start Tempo node
run: docker compose up -d
- name: Wait for Tempo node to be ready
run: |
echo "Waiting for Tempo node to start..."
for i in {1..30}; do
if curl -s http://localhost:8545 > /dev/null 2>&1; then
echo "Tempo node is ready!"
exit 0
fi
echo "Attempt $i: Tempo node not ready yet..."
sleep 2
done
echo "Tempo node failed to start"
docker compose logs
exit 1
- name: Run integration tests (localnet lacks fee token liquidity for on-chain tests)
run: go test -v -run "TestIntegration_NodeConnection|TestIntegration_BuilderValidation|TestIntegration_RoundTrip" -timeout=5m ./tests
env:
TEMPO_RPC_URL: http://localhost:8545
- name: Show Tempo node logs on failure
if: failure()
run: docker compose logs
- name: Stop Tempo node
if: always()
run: docker compose down
integration-devnet:
name: Integration Tests (Devnet)
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Download dependencies
run: go mod download
- name: Run integration tests against devnet
run: go test -v -run TestIntegration -timeout=10m ./tests
env:
TEMPO_RPC_URL: ${{ secrets.TEMPO_DEVNET_RPC_URL }}
integration-testnet:
name: Integration Tests (Testnet)
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Download dependencies
run: go mod download
- name: Run integration tests against testnet
run: go test -v -run TestIntegration -timeout=10m ./tests
env:
TEMPO_RPC_URL: ${{ secrets.TEMPO_TESTNET_RPC_URL }}