chore: make clippy happy #1236
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, pull_request] | |
jobs: | |
lint: | |
name: lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-lint | |
restore-keys: | | |
${{ runner.os }}-lint | |
- name: Setup | Toolchain (clippy) | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
default: true | |
components: clippy | |
- name: Build | Clippy | |
uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all-targets | |
- name: Setup | Toolchain (rustfmt) | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
default: true | |
components: rustfmt | |
- name: Build | Rustfmt | |
run: cargo fmt -- --check | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup | Checkout | |
uses: actions/checkout@v2 | |
- name: Setup | Cache Cargo | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-check | |
restore-keys: | | |
${{ runner.os }}-check | |
- name: Setup | Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
- 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@v2 | |
- name: Setup | Cache Cargo | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo | |
restore-keys: | | |
${{ runner.os }}-cargo | |
- name: Setup | Cache | Example proxy | |
uses: actions/cache@v2 | |
with: | |
path: examples/proxy/target | |
key: wasm32-example-proxy | |
restore-keys: | | |
wasm32-example-proxy | |
- name: Setup | Cache | Example seed | |
uses: actions/cache@v2 | |
with: | |
path: examples/seed/target | |
key: wasm32-example-seed | |
restore-keys: | | |
wasm32-example-seed | |
- name: Setup | Cache | Example vanilla | |
uses: actions/cache@v2 | |
with: | |
path: examples/vanilla/target | |
key: wasm32-example-vanilla | |
restore-keys: | | |
wasm32-example-vanilla | |
- name: Setup | Cache | Example webworker | |
uses: actions/cache@v2 | |
with: | |
path: examples/webworker/target | |
key: wasm32-example-webworker | |
restore-keys: | | |
wasm32-example-webworker | |
- name: Setup | Cache | Example webworker-gloo | |
uses: actions/cache@v2 | |
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@v2 | |
with: | |
path: examples/yew/target | |
key: wasm32-example-yew | |
restore-keys: | | |
wasm32-example-yew | |
- name: Setup | Cache | Example yew-tailwindcss | |
uses: actions/cache@v2 | |
with: | |
path: examples/yew-tailwindcss/target | |
key: wasm32-example-yew-tailwindcss | |
restore-keys: | | |
wasm32-example-yew-tailwindcss | |
- name: Setup | Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
target: wasm32-unknown-unknown | |
- 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 | no-rust | |
run: ${{ matrix.binPath }} --config=examples/no-rust/Trunk.toml build |