chore(ci): Run npm tests for PR #2
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 | |
| - pull_request | |
| env: | |
| RUST_LOG: debug | |
| CARGO_INCREMENTAL: 0 | |
| CI: "1" | |
| jobs: | |
| npm-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup node | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: 20 | |
| - run: | | |
| echo "Before: corepack version => $(corepack --version || echo 'not installed')" | |
| npm install -g corepack@latest | |
| echo "After : corepack version => $(corepack --version)" | |
| corepack enable | |
| pnpm --version | |
| pnpm i | |
| - name: Install Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| profile: minimal | |
| - name: Install wasm target | |
| shell: bash | |
| run: | | |
| rustup target add wasm32-wasip1 | |
| - name: Test | |
| run: | | |
| pnpm test | |
| cargo-test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| name: Test - ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Handle line endings | |
| shell: bash | |
| if: runner.os == 'Windows' | |
| run: | | |
| git config --system core.autocrlf false | |
| git config --system core.eol lf | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: true | |
| - name: Setupz node | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: 16 | |
| - name: Install Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| profile: minimal | |
| override: true | |
| - name: Configure path (windows) | |
| shell: bash | |
| if: runner.os == 'Windows' | |
| run: | | |
| echo 'C:\\npm\\prefix' >> $GITHUB_PATH | |
| - uses: Swatinem/rust-cache@v2 | |
| with: | |
| shared-key: "cargo-test" | |
| cache-on-failure: true | |
| - name: Run cargo test | |
| run: | | |
| cargo test --all --color always | |
| cargo-publish: | |
| name: "Publish" | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| needs: | |
| - cargo-test | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: true | |
| - name: Install Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| profile: minimal | |
| override: true | |
| - name: Install cargo-mono | |
| uses: baptiste0928/cargo-install@v2 | |
| with: | |
| crate: cargo-mono | |
| version: "0.4.1" | |
| locked: true | |
| - name: Publish | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| run: | | |
| cargo mono publish --no-verify |