Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
348 changes: 174 additions & 174 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,174 +1,174 @@
name: CI

on:
push:
branches: [main]
pull_request:
workflow_dispatch:

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

env:
NODE_VERSION: '22'

jobs:
typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run typecheck

unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
# Node's own runner with type stripping, so there is no build step to wait on
# and nothing to install beyond what `npm ci` already fetched.
- run: npm run test:unit

lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run lint

build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run build
- name: Upload dist
uses: actions/upload-artifact@v7
with:
name: dist
path: dist
retention-days: 7

contracts:
name: Contracts
runs-on: ubuntu-latest
defaults:
run:
working-directory: contracts
steps:
- uses: actions/checkout@v5

# rustup ships on the runner image; the toolchain file pins the channel and
# the wasm target, so this only has to make sure the target is present.
- name: Install the wasm target
run: rustup target add wasm32v1-none

# A cold Soroban SDK build is minutes of compile time, and the dependency
# set only moves when the lockfile does.
- name: Cache cargo
uses: actions/cache@v5
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
contracts/target
key: cargo-${{ runner.os }}-${{ hashFiles('contracts/Cargo.lock') }}
restore-keys: cargo-${{ runner.os }}-

- name: Format
run: cargo fmt --all -- --check
- name: Lint
run: cargo clippy --all-targets -- -D warnings
- name: Test
run: cargo test

# The wasm build is the one that has to succeed for the contract to be
# deployable at all: `cargo test` compiles for the host, and the release
# profile the network sees differs from it in ways that can fail on their
# own (no_std, panic = abort, a different target).
- name: Build wasm
run: cargo build --target wasm32v1-none --release
# Both crates, not just one. The workspace builds two contracts and uploading
# only `wave_pool` made the artifact silently incomplete — a deploy taking
# "the bytes CI verified" would have found half of them missing.
- name: Upload wasm
uses: actions/upload-artifact@v5
with:
name: contracts-wasm
path: |
contracts/target/wasm32v1-none/release/wave_pool.wasm
contracts/target/wasm32v1-none/release/wave_escrow.wasm
if-no-files-found: error
retention-days: 7

e2e:
name: End-to-end
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci

# Cache the browser download rather than the ~400MB re-fetch every run.
- name: Resolve Playwright version
id: pw
run: echo "version=$(node -p "require('./node_modules/playwright/package.json').version")" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
id: pw-cache
uses: actions/cache@v6
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.pw.outputs.version }}
- name: Install Chromium
run: npx playwright install --with-deps chromium
if: steps.pw-cache.outputs.cache-hit != 'true'
- name: Install Chromium system deps
run: npx playwright install-deps chromium
if: steps.pw-cache.outputs.cache-hit == 'true'

# The suite runs against the artifact the build job produced, served by
# vite preview, so it exercises what actually ships rather than the dev
# server's on-the-fly transforms.
- name: Download dist
uses: actions/download-artifact@v8
with:
name: dist
path: dist

- name: Smoke test against the preview build
run: |
npm run preview -- --port 4173 --strictPort &
for _ in $(seq 1 60); do
curl -sf http://localhost:4173/ > /dev/null && break
sleep 1
done
node scripts/smoke-test.mjs http://localhost:4173
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
NODE_VERSION: '22'
jobs:
typecheck:
name: Typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run typecheck
unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
# Node's own runner with type stripping, so there is no build step to wait on
# and nothing to install beyond what `npm ci` already fetched.
- run: npm run test:unit
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run lint
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
- run: npm run build
- name: Upload dist
uses: actions/upload-artifact@v7
with:
name: dist
path: dist
retention-days: 7
contracts:
name: Contracts
runs-on: ubuntu-latest
defaults:
run:
working-directory: contracts
steps:
- uses: actions/checkout@v7
# rustup ships on the runner image; the toolchain file pins the channel and
# the wasm target, so this only has to make sure the target is present.
- name: Install the wasm target
run: rustup target add wasm32v1-none
# A cold Soroban SDK build is minutes of compile time, and the dependency
# set only moves when the lockfile does.
- name: Cache cargo
uses: actions/cache@v6
with:
path: |
~/.cargo/registry/index
~/.cargo/registry/cache
~/.cargo/git/db
contracts/target
key: cargo-${{ runner.os }}-${{ hashFiles('contracts/Cargo.lock') }}
restore-keys: cargo-${{ runner.os }}-
- name: Format
run: cargo fmt --all -- --check
- name: Lint
run: cargo clippy --all-targets -- -D warnings
- name: Test
run: cargo test
# The wasm build is the one that has to succeed for the contract to be
# deployable at all: `cargo test` compiles for the host, and the release
# profile the network sees differs from it in ways that can fail on their
# own (no_std, panic = abort, a different target).
- name: Build wasm
run: cargo build --target wasm32v1-none --release
# Both crates, not just one. The workspace builds two contracts and uploading
# only `wave_pool` made the artifact silently incomplete — a deploy taking
# "the bytes CI verified" would have found half of them missing.
- name: Upload wasm
uses: actions/upload-artifact@v7
with:
name: contracts-wasm
path: |
contracts/target/wasm32v1-none/release/wave_pool.wasm
contracts/target/wasm32v1-none/release/wave_escrow.wasm
if-no-files-found: error
retention-days: 7
e2e:
name: End-to-end
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- run: npm ci
# Cache the browser download rather than the ~400MB re-fetch every run.
- name: Resolve Playwright version
id: pw
run: echo "version=$(node -p "require('./node_modules/playwright/package.json').version")" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
id: pw-cache
uses: actions/cache@v6
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ steps.pw.outputs.version }}
- name: Install Chromium
run: npx playwright install --with-deps chromium
if: steps.pw-cache.outputs.cache-hit != 'true'
- name: Install Chromium system deps
run: npx playwright install-deps chromium
if: steps.pw-cache.outputs.cache-hit == 'true'
# The suite runs against the artifact the build job produced, served by
# vite preview, so it exercises what actually ships rather than the dev
# server's on-the-fly transforms.
- name: Download dist
uses: actions/download-artifact@v8
with:
name: dist
path: dist
- name: Smoke test against the preview build
run: |
npm run preview -- --port 4173 --strictPort &
for _ in $(seq 1 60); do
curl -sf http://localhost:4173/ > /dev/null && break
sleep 1
done
node scripts/smoke-test.mjs http://localhost:4173
Loading
Loading