chore(package): add @swc/core
peerDependency
#510
This file contains 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: Format, Build & Test | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
format: | |
name: Format | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Update rust toolchain | |
run: | | |
rustup update | |
rustup show | |
- name: Use rust cache action | |
uses: Swatinem/rust-cache@v2 | |
- name: Run cargo fmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Check workflow permissions | |
id: check_permissions | |
uses: scherermichael-oss/action-has-permission@1.0.6 | |
with: | |
required-permission: write | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run clippy action to produce annotations | |
uses: actions-rs/clippy-check@v1 | |
if: steps.check.outputs.has-permission | |
with: | |
args: --all-features -- -D warnings | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run clippy manually without annotations | |
if: ${{ !steps.check_permissions.outputs.has-permission }} | |
run: cargo clippy --all-features -- -D warnings | |
build: | |
name: Build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Update rust toolchain | |
run: | | |
rustup update | |
rustup show | |
- name: Use rust cache action | |
uses: Swatinem/rust-cache@v2 | |
- name: Run cargo check | |
uses: actions-rs/cargo@v1 | |
with: | |
command: check | |
- name: Run cargo build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
test: | |
name: Library tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Update rust toolchain | |
run: | | |
rustup update | |
rustup show | |
- name: Use rust cache action | |
uses: Swatinem/rust-cache@v2 | |
- name: Setup node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install pnpm | |
run: corepack enable | |
- name: Run cargo test | |
run: pnpm test:lib | |
test-e2e: | |
name: End-to-end tests | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
steps: | |
- name: Checkout branch | |
uses: actions/checkout@v4 | |
- name: Update rust toolchain | |
run: | | |
rustup update | |
rustup show | |
- name: Use rust cache action | |
uses: Swatinem/rust-cache@v2 | |
- name: Setup node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install pnpm & deps | |
run: | | |
corepack enable | |
pnpm install | |
- name: Run npm `test:e2e` | |
run: | | |
pnpm build:release | |
pnpm test --filter=example-api |