Skip to content

Merge pull request #1 from thinkgrid-labs/dev #36

Merge pull request #1 from thinkgrid-labs/dev

Merge pull request #1 from thinkgrid-labs/dev #36

Workflow file for this run

name: Continuous Integration
on:
push:
branches: ["main", "dev"]
pull_request:
branches: ["main", "dev"]
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
jobs:
quality-checks:
name: Lint, Format, and Test
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
shared-key: "recached-ci-cache"
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run Clippy
# wasm-edge requires the wasm32 target to compile — exclude it from native CI.
# It is validated separately in the npm workflow when wasm-pack builds it.
run: cargo clippy --workspace --exclude wasm-edge --all-targets -- -D warnings
- name: Run tests
run: cargo test --workspace --exclude wasm-edge
typecheck-react:
name: Typecheck @recached/react
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
- name: Generate SDK type declarations
run: |
cd wasm-edge && npm install
# wasm-pack isn't available in this job, so create a minimal stub that
# satisfies the TypeScript import so tsc can emit sdk.d.ts for the react step.
mkdir -p pkg
node -e "
require('fs').writeFileSync('pkg/recached_edge.d.ts',
'export class RecachedCache {}\nexport default function init(): Promise<void>;\n'
);
"
npx tsc
- name: Install dependencies
run: cd recached-react && npm install --legacy-peer-deps
- name: Typecheck
run: cd recached-react && npm run typecheck