Skip to content

wip

wip #357

name: Build And Test
on: [push]
env:
CARGO_TERM_COLOR: always
CARGO_TERM_VERBOSE: true
CARGOFLAGS: --workspace --all-targets --all-features
RUST_LOG: trace
RISC0_DEV_MODE: 1
jobs:
# Build ------------------------------------------------------------------------
debug_mode_build:
name: Compile code in debug mode
runs-on: ubicloud-standard-16
steps:
- uses: actions/checkout@v4
- name: Save build artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: "debug-build"
- name: Compile in debug mode
run: cargo build $CARGOFLAGS
release_mode_build:
name: Compile code in release mode
runs-on: ubicloud-standard-16
steps:
- uses: actions/checkout@v4
- name: Save build artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: "release-build"
- name: Compile in release mode
run: cargo build $CARGOFLAGS --release
# Test ------------------------------------------------------------------------
debug_mode_test_with_regtest:
name: Test code in debug mode with Bitcoin Regtest
runs-on: ubicloud-standard-4
needs: debug_mode_build
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: clementine
POSTGRES_USER: clementine
POSTGRES_PASSWORD: clementine
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/service-action
- name: Restore cached build artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: "debug-build"
- name: Run tests on Bitcoin regtest
run: cargo test --verbose --jobs 1
debug_mode_test_with_mock_rpc:
name: Test code in debug mode with Bitcoin Mock RPC
runs-on: ubicloud-standard-16
needs: debug_mode_build
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: clementine
POSTGRES_USER: clementine
POSTGRES_PASSWORD: clementine
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/service-action
- name: Restore cached build artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: "debug-build"
- name: Run tests on mock RPC
run: cargo test --verbose --features mock_rpc
release_mode_test_with_regtest:
name: Test code in release mode with Bitcoin Regtest
runs-on: ubicloud-standard-4
needs: release_mode_build
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: clementine
POSTGRES_USER: clementine
POSTGRES_PASSWORD: clementine
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/service-action
- name: Restore cached build artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: "release-build"
- name: Run tests on Bitcoin regtest with release build
run: cargo test --verbose --jobs 1 --release
release_mode_test_with_mock_rpc:
name: Test code in release mode with Bitcoin Mock RPC
runs-on: ubicloud-standard-16
needs: release_mode_build
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: clementine
POSTGRES_USER: clementine
POSTGRES_PASSWORD: clementine
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/service-action
- name: Restore cached build artifacts
uses: Swatinem/rust-cache@v2
with:
shared-key: "release-build"
- name: Run tests on mock RPC with release build
run: cargo test --verbose --features mock_rpc --release