ci(gitlab): Remove node_modules from cache #33
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: Build & Test | |
on: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- public/**/* | |
- src/**/* | |
- '*.config.*' | |
- index.html | |
- package.json | |
- tsconfig*.json | |
- pnpm-lock.yaml | |
- .github/workflows/build_and_test.yml | |
- .prettier* | |
push: | |
branches: | |
- main | |
paths: | |
- public/**/* | |
- src/**/* | |
- '*.config.*' | |
- index.html | |
- package.json | |
- tsconfig*.json | |
- pnpm-lock.yaml | |
- .github/workflows/build_and_test.yml | |
- .prettier* | |
jobs: | |
build: | |
name: Build & Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: pnpm cache | |
uses: actions/cache@v4 | |
id: pnpm-cache | |
with: | |
path: ~/.pnpm-store/v3/ | |
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm- | |
- name: Rust cache | |
uses: actions/cache@v4 | |
id: rust-cache | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
~/.rustup/ | |
inference/target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Set up Rust and wasm-pack | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
. ~/.cargo/env | |
rustup update | |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
- name: Lint and Build Rust | |
run: | | |
cd inference | |
cargo check | |
cargo clippy | |
wasm-pack build --release --target bundler | |
cd .. | |
- name: Set up pnpm | |
run: | | |
corepack enable | |
corepack install | |
pnpm --version | |
pnpm install | |
- name: Lint TypeScript | |
run: | | |
pnpm run lint | |
pnpm run check | |
- name: Build TypeScipt | |
run: pnpm run build | |
- name: Test project | |
run: pnpm run test -- --run |