chore: build targets in binding package.json #68
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: ${{ github.ref_name != 'main' }} | |
| jobs: | |
| cargo-check: | |
| runs-on: ubuntu-latest | |
| name: Cargo Check | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run cargo check | |
| run: cargo check --workspace | |
| cargo-clippy: | |
| runs-on: ubuntu-latest | |
| name: Cargo Clippy | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: clippy | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run cargo clippy | |
| run: cargo clippy --workspace -- -D warnings | |
| build: | |
| name: Build | |
| uses: rspack-contrib/rspack-toolchain/.github/workflows/build.yml@main | |
| test: | |
| runs-on: ${{ matrix.os }} | |
| name: Node.js Test (${{ matrix.os }}) | |
| needs: build | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Get NAPI info | |
| id: napi-info | |
| uses: rspack-contrib/rspack-toolchain/get-napi-info@main | |
| - name: Download rspack binding | |
| uses: rspack-contrib/rspack-toolchain/download-rspack-binding@main | |
| with: | |
| target: ${{ matrix.target }} | |
| path: ${{ steps.napi-info.outputs.binding-path }} | |
| - name: Show binding | |
| shell: bash | |
| run: | | |
| echo "Contents of binding directory:" | |
| ls -la ${{ steps.napi-info.outputs.binding-path }} | |
| echo "" | |
| echo "*.node files:" | |
| find ${{ steps.napi-info.outputs.binding-path }} -name "*.node" -type f -exec ls -la {} \; || echo "No .node files found" | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Enable corepack | |
| run: corepack enable | |
| - name: Setup pnpm | |
| run: corepack prepare | |
| - name: Cache pnpm dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.pnpm-store | |
| key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm- | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Run example - plugin | |
| run: node build.js | |
| working-directory: examples/plugin |