Skip to content

waved: fix seed recovery missing live VTXOs #4073

waved: fix seed recovery missing live VTXOs

waved: fix seed recovery missing live VTXOs #4073

Workflow file for this run

name: CI
on:
push:
branches:
- "main"
pull_request:
branches:
- "*"
merge_group:
branches:
- "main"
permissions:
# Required to manage and delete caches.
actions: write
# Default permission for checking out code.
contents: read
concurrency:
# Cancel any previous workflows if they are from a PR or push.
group: ${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
env:
# If you change this please also update GO_VERSION in Makefile.
GO_VERSION: 1.26.0
jobs:
########################
# commit message lint
########################
commit-message:
name: Commit Message
runs-on: [self-hosted]
steps:
- name: Git checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Lint commit messages
env:
EVENT_NAME: ${{ github.event_name }}
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
BEFORE_SHA: ${{ github.event.before }}
GITHUB_SHA: ${{ github.sha }}
run: |
if [ "$EVENT_NAME" = "pull_request" ]; then
range="$BASE_SHA..$HEAD_SHA"
elif [ "$EVENT_NAME" = "push" ] &&
[ "$BEFORE_SHA" != "0000000000000000000000000000000000000000" ]; then
range="$BEFORE_SHA..$GITHUB_SHA"
else
range="$(git rev-parse HEAD^ 2>/dev/null)..HEAD"
fi
make commitmsg-lint range="$range"
########################
# static checks
########################
static-checks:
name: Static Checks
runs-on: [self-hosted]
steps:
- name: Git checkout
uses: actions/checkout@v5
with:
# Needed for some checks.
fetch-depth: 0
# Uncomment this step if you want to enable cleanup of runner space.
#- name: Clean up runner space
# uses: ./.github/actions/cleanup-space
- name: Setup Go ${{ env.GO_VERSION }}
uses: ./.github/actions/setup-go
with:
go-version: '${{ env.GO_VERSION }}'
use-build-cache: 'no'
########################
# Check code format
########################
# Disable go.work so CI tests modules as external consumers would see them.
# The workspace is for developer convenience only.
- name: Check changed code format
if: github.event_name == 'pull_request'
run: make fmt-changed-check base=${{ github.event.pull_request.base.sha }}
env:
GOWORK: off
- name: Check code format
if: github.event_name != 'pull_request'
run: make fmt-check
env:
GOWORK: off
- name: Check go modules tidiness
run: make tidy-module-check
env:
GOWORK: off
########################
# Sample configuration check
########################
- name: Check sample waved config
run: make sample-conf-check
env:
GOWORK: off
########################
# SQLC code gen check
########################
- name: Docker image cache
uses: satackey/action-docker-layer-caching@v0.0.11
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true
- name: Check SQL models
run: make sqlc-check
########################
# Migration version check
########################
- name: Check migration version
run: make check-migration-version
########################
# lint code
########################
lint:
name: Lint code
runs-on: [self-hosted]
steps:
- name: git checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: setup go ${{ env.GO_VERSION }}
uses: ./.github/actions/setup-go
with:
go-version: '${{ env.GO_VERSION }}'
# Use the same cache from unit test job to save time.
key-prefix: unit-test
- name: lint
run: GOGC=50 make lint
########################
# P formal model check
########################
p-model:
name: P durable mailbox model
runs-on: [self-hosted]
steps:
- name: Git checkout
uses: actions/checkout@v5
- name: Setup go ${{ env.GO_VERSION }}
uses: ./.github/actions/setup-go
with:
go-version: '${{ env.GO_VERSION }}'
key-prefix: p-model
use-build-cache: 'no'
# The self-hosted ARC runners cannot write to the default
# /usr/share/dotnet, so install the SDK under the writable runner temp
# dir. setup-dotnet honours DOTNET_INSTALL_DIR and adds it to PATH and
# DOTNET_ROOT for later steps.
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
env:
DOTNET_INSTALL_DIR: ${{ runner.temp }}/dotnet
- name: Install P checker
run: |
dotnet tool install --global P --version 3.0.4
echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH"
env:
DOTNET_INSTALL_DIR: ${{ runner.temp }}/dotnet
# Compiles the P model, model-checks the green safety suite
# (tcMailboxCorrelationKeyFIFO) and the liveness property
# (tcMailboxLiveness), then replays the model traces against the real
# actordelivery SQLite store via the Go bridge. GOWORK is disabled so the
# bridge builds against the module exactly as an external consumer would.
- name: Check P model and bridge conformance
run: ./p-models/scripts/check.sh
env:
GOWORK: off
########################
# cross compilation
########################
cross-compile:
name: Cross compilation
runs-on: [self-hosted]
strategy:
fail-fast: true
matrix:
include:
- name: linux-amd64
sys: linux-amd64
- name: linux-arm64
sys: linux-arm64
- name: linux-armv7
sys: linux-armv7
- name: darwin-amd64
sys: darwin-amd64
- name: darwin-arm64
sys: darwin-arm64
- name: windows-amd64
sys: windows-amd64
steps:
- name: Git checkout
uses: actions/checkout@v5
- name: Setup go ${{ env.GO_VERSION }}
uses: ./.github/actions/setup-go
with:
go-version: '${{ env.GO_VERSION }}'
key-prefix: cross-compile
use-build-cache: 'no'
- name: Build release for ${{ matrix.name }}
run: make release sys="${{ matrix.sys }}"
########################
# run unit tests
########################
unit-test:
name: Run unit tests
runs-on: [self-hosted]
strategy:
# Allow other tests in the matrix to continue if one fails.
fail-fast: false
matrix:
unit_type:
- unit-cover
- unit tags="test_sqlite"
- unit tags="test_postgres"
- unit-swapruntime
- unit-race
steps:
- name: Git checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Fetch and rebase on ${{ github.base_ref }}
if: github.event_name == 'pull_request'
uses: ./.github/actions/rebase
- name: Setup go ${{ env.GO_VERSION }}
uses: ./.github/actions/setup-go
with:
go-version: '${{ env.GO_VERSION }}'
key-prefix: unit-test
- name: Run ${{ matrix.unit_type }}
# Run with sudo as harness uses user 0:0 which needs extra permissions
# on the github runner in order for docker mounts to work correctly.
# Bump the per-package test timeout from Go's 10m default because the
# ARC runners boot the test harness slower than Depot/local; 30m is
# generous headroom while still failing on a real hang.
run: sudo env "PATH=$PATH" "GOPATH=$GOPATH" make ${{ matrix.unit_type }} timeout=30m
- name: Clean coverage
run: grep -Ev '(\.pb\.go|\.pb\.json\.go|\.pb\.gw\.go|db/sqlc/)' coverage.txt > coverage-norpc.txt
if: matrix.unit_type == 'unit-cover'
- name: Send coverage
uses: coverallsapp/github-action@v2
if: matrix.unit_type == 'unit-cover'
continue-on-error: true
with:
file: coverage-norpc.txt
flag-name: 'unit'
format: 'golang'
parallel: true
- name: Fix artifact permissions
if: always()
run: |
# Fix permissions for test artifacts (created in package directories)
find . -type d -name "test-artifacts" -exec sudo chown -R "$(id -u):$(id -g)" {} + || true
find . -type d -name "test-artifacts" -exec sudo chmod -R a+r {} + || true
- name: Set artifact name
if: failure()
id: artifact-name
run: |
# Sanitize matrix.unit_type for use in artifact name
SAFE_NAME=$(echo "${{ matrix.unit_type }}" | sed 's/[^a-zA-Z0-9_-]/_/g')
echo "name=test-artifacts-${SAFE_NAME}-${{ github.run_id }}" >> $GITHUB_OUTPUT
- name: Upload test artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact-name.outputs.name }}
path: |
**/test-artifacts/
retention-days: 5
if-no-files-found: ignore
########################
# run system integration tests
########################
systest:
name: Run system tests
runs-on: [self-hosted]
strategy:
# Allow other tests in the matrix to continue if one fails.
fail-fast: false
matrix:
db_backend:
- sqlite
- postgres
steps:
- name: Git checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Fetch and rebase on ${{ github.base_ref }}
if: github.event_name == 'pull_request'
uses: ./.github/actions/rebase
- name: Setup go ${{ env.GO_VERSION }}
uses: ./.github/actions/setup-go
with:
go-version: '${{ env.GO_VERSION }}'
key-prefix: systest
- name: Run systest with ${{ matrix.db_backend }}
# Run with sudo as harness uses user 0:0 which needs extra permissions
# on the github runner in order for docker mounts to work correctly.
# Bump per-package test timeout above the Makefile default for the
# same ARC-vs-Depot harness-boot speed reasons documented in the unit
# test job above.
run: sudo env "PATH=$PATH" "GOPATH=$GOPATH" make systest-verbose db=${{ matrix.db_backend }} SYSTEST_TIMEOUT=30m
- name: Fix artifact permissions
if: always()
run: |
# Fix permissions for test artifacts (created in package directories)
find . -type d -name "test-artifacts" -exec sudo chown -R "$(id -u):$(id -g)" {} + || true
find . -type d -name "test-artifacts" -exec sudo chmod -R a+r {} + || true
- name: Upload test artifacts on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: systest-artifacts-${{ matrix.db_backend }}-${{ github.run_id }}
path: |
**/test-artifacts/
retention-days: 5
if-no-files-found: ignore