name: ci
on:
push:
branches: ["main"]
pull_request:
schedule:
- cron: "0 8 * * *"
jobs:
pr-paths:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
outputs:
packaging: ${{ steps.filter.outputs.packaging }}
windows: ${{ steps.filter.outputs.windows }}
steps:
- uses: actions/checkout@v4
- id: filter
uses: dorny/paths-filter@v3
with:
filters: |
packaging:
- 'build.rs'
- 'Cargo.toml'
- 'Cargo.lock'
- 'c/**'
- 'vendor/lite3/**'
- 'src/**'
- 'bindings/**'
- 'scripts/**'
- 'include/**'
- '.github/workflows/**'
windows:
- 'build.rs'
- 'Cargo.toml'
- 'Cargo.lock'
- 'c/**'
- 'vendor/lite3/**'
- 'src/**'
- 'tests/**'
- 'bindings/node/**'
- 'bindings/python/**'
- 'scripts/**'
- '.github/workflows/**'
pr-fast:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: actions/setup-go@v5
with:
go-version: "1.22"
cache-dependency-path: bindings/go/go.sum
- uses: actions/setup-node@v4
with:
node-version: "20"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: taiki-e/install-action@v2
with:
tool: just
- run: cd bindings/node && npm ci
- run: just ci-fast
dist-smoke:
needs: [pr-paths]
if: github.event_name == 'pull_request' && needs.pr-paths.outputs.packaging == 'true'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
- os: macos-15-intel
target: x86_64-apple-darwin
- os: macos-latest
target: aarch64-apple-darwin
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- uses: actions/setup-node@v4
with:
node-version: "20"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: astral-sh/setup-uv@v5
- run: cd bindings/node && npm ci
- name: Build SDK artifacts for packaging smoke
shell: bash
run: |
cargo build --release --target "${{ matrix.target }}" --bins
if [[ "${{ matrix.target }}" == *apple-darwin ]]; then
cargo rustc --release --target "${{ matrix.target }}" --lib --crate-type=cdylib -- -C link-arg=-Wl,-install_name,@rpath/libplasmite.dylib
else
cargo rustc --release --target "${{ matrix.target }}" --lib --crate-type=cdylib -- -C link-arg=-Wl,-soname,libplasmite.so
fi
- name: Node npm pack/install smoke
env:
PLASMITE_SDK_DIR: ${{ github.workspace }}/target/${{ matrix.target }}/release
run: ./scripts/node_pack_smoke.sh
- name: Node remote-only smoke
run: ./scripts/node_remote_only_smoke.sh
- name: Python wheel build/install smoke
env:
PLASMITE_SDK_DIR: ${{ github.workspace }}/target/${{ matrix.target }}/release
run: ./scripts/python_wheel_smoke.sh
windows-smoke:
needs: [pr-paths]
if: >-
always()
&& (github.event_name != 'pull_request'
|| needs.pr-paths.outputs.windows == 'true')
continue-on-error: true
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build release binaries
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
cargo build --release --bins
- name: Smoke CLI version
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
.\target\release\plasmite.exe --version
- name: Local pool roundtrip smoke
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$PSNativeCommandUseErrorActionPreference = $true
$dir = ".scratch/windows-smoke"
$pool = "ci-smoke"
$exe = ".\target\release\plasmite.exe"
$payloadPath = "$dir\payload.json"
Remove-Item -Recurse -Force $dir -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path $dir | Out-Null
Set-Content -Path $payloadPath -Value '{"ci":"windows-smoke"}' -NoNewline
& $exe --dir $dir pool create $pool
& $exe --dir $dir feed $pool -f $payloadPath
$out = & $exe --dir $dir follow $pool --tail 1 --one --timeout 2s --data-only --format jsonl
if (-not ($out -match '"ci":"windows-smoke"')) {
throw "Roundtrip payload marker missing from follow output."
}
full:
if: github.event_name != 'pull_request'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, ubuntu-24.04-arm]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: actions/setup-go@v5
with:
go-version: "1.22"
cache-dependency-path: bindings/go/go.sum
- uses: actions/setup-node@v4
with:
node-version: "20"
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: taiki-e/install-action@v2
with:
tool: just
- run: cd bindings/node && npm ci
- run: just ci
audit:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.88.0
- uses: taiki-e/install-action@v2
with:
tool: just
- uses: taiki-e/install-action@v2
with:
tool: cargo-audit
- run: just audit