WindTunnel Scenario Packaging #42
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "test" | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install nix | |
uses: cachix/install-nix-action@v25 | |
with: | |
install_url: https://releases.nixos.org/nix/nix-2.20.4/install | |
extra_nix_config: | | |
experimental-features = flakes nix-command | |
- uses: cachix/cachix-action@v14 | |
with: | |
name: holochain-wind-tunnel | |
extraPullNames: holochain-ci | |
authToken: ${{ secrets.CACHIX_HOLOCHAIN_WIND_TUNNEL }} | |
- name: Check scripts | |
run: | | |
nix develop --command bash -c "shellcheck scripts/*.sh" | |
- name: Check Nix formatting | |
run: | | |
nix develop .#ci --command bash -c "source ./scripts/checks.sh && check_nix_fmt" | |
- name: Lint Nix | |
run: | | |
nix develop .#ci --command bash -c "source ./scripts/checks.sh && check_nix_static" | |
- name: Check Rust formatting | |
run: | | |
nix develop .#ci --command bash -c "source ./scripts/checks.sh && check_rust_fmt" | |
- name: Lint Rust | |
env: | |
SKIP_HAPP_BUILD: 1 # Prevent hApp builds from running when linting | |
run: | | |
nix develop --command bash -c "source ./scripts/checks.sh && check_rust_static" | |
- name: Build and unit tests | |
run: | | |
nix build .#workspace | |
- name: Smoke test - zome_call_single_value | |
run: | | |
# Start a sandbox conductor and run it in the background | |
nix develop --command bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &" | |
# Run the scenario for 5 seconds | |
RUST_LOG=info nix run .#zome_call_single_value --connection-string ws://localhost:8888 --duration 5 --no-progress --no-metrics | |
pkill hc | |
pkill holochain | |
pkill lair-keystore | |
- name: Smoke test - single_write_many_read | |
run: | | |
# Start a sandbox conductor and run it in the background | |
nix develop --command bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &" | |
# Run the scenario for 5 seconds | |
RUST_LOG=info nix run .#single_write_many_read -- --connection-string ws://localhost:8888 --duration 5 --no-progress --no-metrics | |
pkill hc | |
pkill holochain | |
pkill lair-keystore | |
- name: Smoke test - dht_sync_lag | |
run: | | |
# Start a sandbox conductor and run it in the background | |
nix develop --command bash -c "hc s clean && echo "1234" | hc s --piped create && echo "1234" | hc s --piped -f 8888 run &" | |
# Run the scenario for 5 seconds | |
RUST_LOG=info nix run .#dht_sync_lag -- --connection-string ws://localhost:8888 --agents 2 --behaviour write:1 --behaviour record_lag:1 --duration 5 --no-progress --no-metrics | |
pkill hc | |
pkill holochain | |
pkill lair-keystore | |
- name: Build scenario bundles | |
run: | | |
set -euxo pipefail | |
scenario_names() { | |
find scenarios/ -mindepth 1 -maxdepth 1 -type d -printf "%f\n" | |
} | |
# Disable sandbox because hApp builds aren't done by Nix and need network access. | |
scenario_names | xargs -I % nix bundle --option sandbox false .#packages.x86_64-linux.% | |
mkdir -p dist | |
scenario_names | xargs -I % cp % dist/ | |
- name: Archive scenario bundles | |
uses: actions/upload-artifact@v4 | |
with: | |
name: scenario-bundles | |
if-no-files-found: error | |
path: dist/* |