Skip to content

Improvements

Improvements #354

Workflow file for this run

name: Lint
on:
push:
branches: ["main"]
pull_request:
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
env:
CARGO_INCREMENTAL: 0
CARGO_TERM_COLOR: always
CLICOLOR_FORCE: ""
jobs:
cargo-shim:
name: Check Cargo Shim
runs-on: ubuntu-latest
timeout-minutes: 20
env:
XWIN_ARCH: x86_64
# https://learn.microsoft.com/en-us/visualstudio/releases/2026/servicing-vs#support-for-older-versions
XWIN_VERSION: 17
# https://learn.microsoft.com/en-us/windows/apps/windows-sdk/release-notes
XWIN_SDK_VERSION: 10.0.26100
# https://learn.microsoft.com/en-us/visualstudio/install/workload-component-id-vs-build-tools#desktop-development-with-c
XWIN_CRT_VERSION: 14.44.17.14
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Stable Rust Override
run: cp .github/rust-toolchain.toml .
- name: Install Rust
run: rustup install --no-update
- name: Install Target
run: rustup target add x86_64-pc-windows-msvc
- name: Install `cargo-xwin`
uses: taiki-e/install-action@v2
with:
tool: cargo-xwin
- name: Restore `cargo-xwin` Cache
uses: actions/cache/restore@v6
with:
path: ~/.cache/cargo-xwin
key:
cargo-xwin-cache-${{ env.XWIN_VERSION }}-${{ env.XWIN_SDK_VERSION }}-${{
env.XWIN_CRT_VERSION }}
- name: Download `cargo-xwin` Cache
run: cargo xwin cache xwin
- name: Save `cargo-xwin` Cache
uses: actions/cache/save@v6
with:
path: ~/.cache/cargo-xwin
key:
cargo-xwin-cache-${{ env.XWIN_VERSION }}-${{ env.XWIN_SDK_VERSION }}-${{
env.XWIN_CRT_VERSION }}
- name: Build Cargo Shims
working-directory: host
env:
RUSTFLAGS: -Clink-arg=/Brepro
CARGO_PROFILE_RELEASE_OPT_LEVEL: z
CARGO_PROFILE_RELEASE_LTO: fat
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1
CARGO_PROFILE_RELEASE_PANIC: abort
run:
cargo xwin build -p cargo-shim --bin linker --bin runner --target x86_64-pc-windows-msvc
--release
- name: Copy Binaries
working-directory: host
run: |
cp target/x86_64-pc-windows-msvc/release/linker.exe cargo-shim
cp target/x86_64-pc-windows-msvc/release/runner.exe cargo-shim
- name: Check for Changes
id: verify
run: |
git add -A
git diff --staged --exit-code
- name: Upload Cargo Shims
if: always() && steps.verify.outcome == 'failure'
uses: actions/upload-artifact@v7
with:
name: cargo-shims
retention-days: 1
path: |
host/cargo-shim/linker.exe
host/cargo-shim/runner.exe
tsc:
name: TSC - `${{ matrix.package.name }}`
runs-on: ubuntu-slim
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
package:
- { name: js-bindgen-cli-lib, path: host/cli-lib/src/js }
- { name: js-bindgen-runner, path: host/runner/src/js }
defaults:
run:
working-directory: ${{ matrix.package.path }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: NPM Install
run: npm install --no-audit --no-fund
- name: Install TSC
run: npm install -g typescript --no-audit --no-fund
- name: Run TSC
run: tsc -b
- name: Check for Changes
run: |
git add -A
git diff --staged --exit-code
eslint:
name: ESLint - `${{ matrix.package.name }}`
runs-on: ubuntu-slim
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
package:
- { name: js-bindgen-cli-lib, path: host/cli-lib/src/js }
- { name: js-bindgen-runner, path: host/runner/src/js }
defaults:
run:
working-directory: ${{ matrix.package.path }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: NPM Install
run: npm install --no-audit --no-fund
- name: Run ESLint
run: npx eslint
tombi:
name: Tombi Lint
runs-on: ubuntu-slim
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Install Tombi
run: npm install -g tombi --no-audit --no-fund
- name: Tombi Lint
run: tombi lint --error-on-warnings
zizmor:
name: Zizmor
runs-on: ubuntu-slim
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Install Zizmor
uses: taiki-e/install-action@v2
with:
tool: zizmor
- name: Run Zizmor
run: zizmor --pedantic .