Repository navigation
68 lines (62 loc) · 2.59 KB
/
Copy pathci.yml
File metadata and controls
68 lines (62 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
permissions:
contents: read
# A newer push to the same pull request supersedes this run; a branch's runs
# queue instead.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
jobs:
# The toolchain matrix (stable, beta, nightly), the same build and tests on
# the other platforms (core#9: paths, line endings and executable lookup are
# where they're expected to differ), and a stable canary on ubuntu-26.04 that
# may fail without failing the run. The reusable workflow's own jobs set the
# runner, the timeouts and the pinned actions.
rust:
name: rust
permissions:
contents: read
uses: ComlineProject/.github/.github/workflows/rust-ci.yml@807dd25bcbf848275f5f2bc5dcdd15070dcc321b # main, no release tag yet
with:
# The external-generator tests build their fixture generators for
# wasm32-wasip1 (tests/cli/external.rs).
targets: wasm32-wasip1
# Stays a local job: the CI images have neither rustfmt nor clippy, which
# the reusable workflow doesn't run either. Pinned to the toolchain
# `rust-toolchain.toml` names.
lint:
name: Lint
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install Rust
uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1
with:
toolchain: 1.99.1
components: rustfmt, clippy
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
- name: rustfmt
run: cargo fmt --check
# `--locked`: Cargo.lock is committed, and release.yml builds with it.
# A pin moved without the lock (cli#166) fails here, not at release.
- name: clippy
run: cargo clippy --locked --all-targets -- -D warnings
- name: clippy (without gen-wasm)
run: cargo clippy --all-targets --no-default-features --features gen-rust,gen-typescript -- -D warnings
- name: rustfmt (fixture generators)
run: cargo fmt --check --manifest-path tests/fixtures/generators/Cargo.toml
- name: rustfmt (fixture conformance implementations)
run: cargo fmt --check --manifest-path tests/fixtures/conformance/Cargo.toml