tooling: lint floor, cargo-deny, toolchain pin, dev port [skip releas… #119
This file contains hidden or 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: | |
| pull_request: | |
| push: | |
| branches: [main] | |
| # Every job only reads the repo (checkout, install, build, lint, test, cdk synth); | |
| # none write, release, or assume AWS. Pin the default GITHUB_TOKEN to read-only. | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| web: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 | |
| with: | |
| node-version: lts/* | |
| cache: pnpm | |
| cache-dependency-path: web/pnpm-lock.yaml | |
| - run: pnpm install --frozen-lockfile | |
| working-directory: web | |
| - run: pnpm exec biome check src | |
| working-directory: web | |
| - run: pnpm run build | |
| working-directory: web | |
| rust: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable | |
| with: | |
| components: rustfmt, clippy | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| workspaces: crates | |
| - run: cargo fmt --manifest-path crates/Cargo.toml --all -- --check | |
| - run: cargo clippy --manifest-path crates/Cargo.toml --all-features --locked -- -D warnings | |
| # web/src/generated/{weather,geojson}.ts are generated (from | |
| # contract.rs and the typed-geojson crate) and biome-formatted | |
| # ('just build types'); rerun the pipeline and fail on drift | |
| - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 | |
| with: | |
| node-version: lts/* | |
| cache: pnpm | |
| cache-dependency-path: web/pnpm-lock.yaml | |
| - run: pnpm install --frozen-lockfile | |
| working-directory: web | |
| - run: cargo test --manifest-path crates/Cargo.toml -p weather-ingest --features ts --locked | |
| - run: pnpm exec biome format --write src/generated/ | |
| working-directory: web | |
| - run: git diff --exit-code web/src/generated | |
| cdk: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| # synth compiles weather-ingest via cargo-lambda-cdk and stages the | |
| # prebuilt martin zip, so this needs the Rust toolchain, cargo-lambda, | |
| # and the martin binary — but no AWS creds: the stack is env-agnostic | |
| # (no fromLookup; ARNs and the hosted-zone id are pinned). | |
| - uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable | |
| - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| with: | |
| workspaces: crates | |
| - name: Install cargo-lambda | |
| run: pip install cargo-lambda==1.9.1 | |
| - name: Build martin lambda zip | |
| run: scripts/build-martin-lambda.sh build/martin-lambda.zip | |
| - uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6 | |
| with: | |
| version: 10 | |
| - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 | |
| with: | |
| node-version: lts/* | |
| cache: pnpm | |
| cache-dependency-path: cdk/pnpm-lock.yaml | |
| # tsx synth transpiles without type-checking, so tsc --noEmit guards | |
| # the types; synth then exercises the constructs + RustFunction build. | |
| - name: typecheck + synth | |
| working-directory: cdk | |
| run: | | |
| pnpm install --frozen-lockfile | |
| pnpm run typecheck | |
| pnpm exec cdk synth --quiet | |
| deny: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 10 | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - uses: EmbarkStudios/cargo-deny-action@bb137d7af7e4fb67e5f82a49c4fce4fad40782fe # v2.0.20 | |
| with: | |
| manifest-path: crates/Cargo.toml | |
| command: check advisories bans licenses sources | |