name: "Rust Matrix Build & Test"
on:
pull_request:
branches: ["main"]
env:
CARGO_TERM_COLOR: always
SCCACHE_GHA_ENABLED: "on"
jobs:
jetstream-wasm:
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable]
package: [jetstream_wireformat, jetstream_rpc]
steps:
- uses: actions/checkout@v3
- name: Setup Rust ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: wasm32-unknown-unknown
override: true
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Run sccache-cache only on non-release runs
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
uses: mozilla-actions/sccache-action@v0.0.9
- name: Set Rust caching env vars only on non-release runs
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Build and test
run: |
cargo build -p ${{ matrix.package }} --verbose --target wasm32-unknown-unknown
jetstream:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
rust: [stable, beta, nightly]
steps:
- uses: actions/checkout@v3
- name: Setup Rust ${{ matrix.rust }}
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
override: true
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Run sccache-cache only on non-release runs
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
uses: mozilla-actions/sccache-action@v0.0.9
- name: Set Rust caching env vars only on non-release runs
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Build and test
run: |
cargo build -p jetstream --verbose
cargo test -p jetstream --verbose --all-features
examples:
needs: jetstream
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
- os: windows-latest
- os: macos-latest
steps:
- uses: actions/checkout@v3
- name: Setup Rust stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Setup sccache
uses: mozilla-actions/sccache-action@v0.0.9
- name: Run sccache-cache only on non-release runs
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
uses: mozilla-actions/sccache-action@v0.0.9
- name: Set Rust caching env vars only on non-release runs
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Run example echo
run: cargo run --example echo --features quic
- name: Run example sqlite_mtls
run: cargo run --example sqlite_mtls --features quic
- name: Run example iroh_echo
run: cargo run --example iroh_echo --features iroh