feat: implement visitors #285
Workflow file for this run
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: Main | |
| on: | |
| push: | |
| branches: ["main"] | |
| pull_request: | |
| env: | |
| RUSTFLAGS: "-Dwarnings" | |
| RUST_TOOLCHAIN: "1.91.1" | |
| jobs: | |
| lint: | |
| name: Format and Lint Crates | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Git Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install Rust Toolchain and Components | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.RUST_TOOLCHAIN }} | |
| components: clippy, rustfmt | |
| - name: Run Cargo fmt | |
| run: cargo +${{ env.RUST_TOOLCHAIN }} fmt --all -- --check | |
| - name: Run Cargo clippy | |
| run: cargo +${{ env.RUST_TOOLCHAIN }} clippy --all-targets --all-features | |
| test: | |
| name: Test Crates | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Git Checkout | |
| uses: actions/checkout@v4 | |
| - name: Cache Dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run Cargo test | |
| run: cargo +${{ env.RUST_TOOLCHAIN }} test --all-features | |
| spec-generators: | |
| name: Verify Generated Code Is Up To Date | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Git Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| - name: Install Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| cache-dependency-path: spec-generators/pnpm-lock.yaml | |
| - name: Install Rust Toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.RUST_TOOLCHAIN }} | |
| components: rustfmt | |
| - name: Install JS dependencies | |
| working-directory: spec-generators | |
| run: pnpm install --frozen-lockfile | |
| - name: Lint JS generator | |
| working-directory: spec-generators | |
| run: pnpm lint | |
| - name: Type-check + unit-test JS generator | |
| working-directory: spec-generators | |
| run: pnpm test | |
| - name: Regenerate Rust sources from spec | |
| working-directory: spec-generators | |
| run: pnpm generate | |
| - name: Fail if generated sources are out of date | |
| run: | | |
| if ! git diff --exit-code; then | |
| echo "::error::Generated sources are out of date. Run \`pnpm generate\` inside spec-generators/ and commit the diff." | |
| exit 1 | |
| fi |