Bring back trunk-ng into trunk #1297
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: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-lint | |
restore-keys: | | |
${{ runner.os }}-lint | |
- name: Setup | Toolchain (clippy) | |
run: | | |
rustup toolchain install stable --component clippy | |
rustup default stable | |
- name: Build | Clippy | |
run: | | |
cargo clippy --all-targets --all-features -- -D warnings | |
- name: Build | Rustfmt | |
run: cargo fmt -- --check | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-check | |
restore-keys: | | |
${{ runner.os }}-check | |
- name: Setup | Rust | |
run: | | |
rustup toolchain install stable | |
rustup default stable | |
- name: Build | Check | |
run: cargo check --all | |
test: | |
needs: check # Ensure check is run first. | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
include: | |
- os: ubuntu-latest | |
binPath: target/debug/trunk | |
- os: macos-latest | |
binPath: target/debug/trunk | |
- os: windows-latest | |
binPath: target/debug/trunk.exe | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo | |
restore-keys: | | |
${{ runner.os }}-cargo | |
- name: Setup | Cache | Example proxy | |
uses: actions/cache@v3 | |
with: | |
path: examples/proxy/target | |
key: wasm32-example-proxy | |
restore-keys: | | |
wasm32-example-proxy | |
- name: Setup | Cache | Example seed | |
uses: actions/cache@v3 | |
with: | |
path: examples/seed/target | |
key: wasm32-example-seed | |
restore-keys: | | |
wasm32-example-seed | |
- name: Setup | Cache | Example vanilla | |
uses: actions/cache@v3 | |
with: | |
path: examples/vanilla/target | |
key: wasm32-example-vanilla | |
restore-keys: | | |
wasm32-example-vanilla | |
- name: Setup | Cache | Example webworker | |
uses: actions/cache@v3 | |
with: | |
path: examples/webworker/target | |
key: wasm32-example-webworker | |
restore-keys: | | |
wasm32-example-webworker | |
- name: Setup | Cache | Example webworker-gloo | |
uses: actions/cache@v3 | |
with: | |
path: examples/webworker-gloo/target | |
key: wasm32-example-webworker-gloo | |
restore-keys: | | |
wasm32-example-webworker-gloo | |
- name: Setup | Cache | Example yew | |
uses: actions/cache@v3 | |
with: | |
path: examples/yew/target | |
key: wasm32-example-yew | |
restore-keys: | | |
wasm32-example-yew | |
- name: Setup | Cache | Example yew-tailwindcss | |
uses: actions/cache@v3 | |
with: | |
path: examples/yew-tailwindcss/target | |
key: wasm32-example-yew-tailwindcss | |
restore-keys: | | |
wasm32-example-yew-tailwindcss | |
- name: Setup | Cache | Example yew-tls | |
uses: actions/cache@v3 | |
with: | |
path: examples/yew-tls/target | |
key: wasm32-example-yew-tls | |
restore-keys: | | |
wasm32-example-yew-tls | |
- name: Setup | Rust | |
run: | | |
rustup toolchain install stable --target wasm32-unknown-unknown | |
rustup default stable | |
- name: Build | Test | |
run: cargo test | |
# Run the CLI to ensure we don't have any subtle runtime issues. | |
- name: Build | Run | |
run: cargo run -- -h | |
# Build examples via our newly built debug artifact. | |
- name: Build | Examples | proxy | |
run: ${{ matrix.binPath }} --config=examples/proxy/Trunk.toml build | |
- name: Build | Examples | seed | |
run: ${{ matrix.binPath }} --config=examples/seed/Trunk.toml build | |
- name: Build | Examples | vanilla | |
run: ${{ matrix.binPath }} --config=examples/vanilla/Trunk.toml build | |
- name: Build | Examples | webworker | |
run: ${{ matrix.binPath }} --config=examples/webworker/Trunk.toml build | |
- name: Build | Examples | webworker-gloo | |
run: ${{ matrix.binPath }} --config=examples/webworker-gloo/Trunk.toml build | |
- name: Build | Examples | yew | |
run: ${{ matrix.binPath }} --config=examples/yew/Trunk.toml build | |
- name: Build | Examples | yew-tailwindcss | |
run: ${{ matrix.binPath }} --config=examples/yew-tailwindcss/Trunk.toml build | |
- name: Build | Examples | yew-tls | |
run: ${{ matrix.binPath }} --config=examples/yew-tls/Trunk.toml build | |
- name: Build | Examples | no-rust | |
run: ${{ matrix.binPath }} --config=examples/no-rust/Trunk.toml build |