File: node.yml

package info (click to toggle)
tokenizers 0.20.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 5,480 kB
  • sloc: python: 4,499; javascript: 419; makefile: 124
file content (64 lines) | stat: -rw-r--r-- 1,692 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Node
on:
  push:
    branches:
      - main
    paths-ignore:
      - bindings/python/**
  pull_request:
    paths-ignore:
      - bindings/python/**

jobs:
  build_and_test:
    name: Check everything builds
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy

      # Necessary for now for the cargo cache: https://github.com/actions/cache/issues/133#issuecomment-599102035
      - run: sudo chown -R $(whoami):$(id -ng) ~/.cargo/

      - name: Cache Cargo Registry
        uses: actions/cache@v4
        with:
          path: ~/.cargo/registry
          key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}

      - name: Install Node
        uses: actions/setup-node@v4
        with:
          node-version: latest
      - name: Install dependencies
        working-directory: ./bindings/node
        run: yarn install

      - name: Build all
        working-directory: ./bindings/node
        run: yarn build

      - name: Lint Rust formatting
        uses: actions-rs/cargo@v1
        with:
          command: fmt
          args: --manifest-path ./bindings/node/Cargo.toml -- --check

      - name: Lint Rust with Clippy
        uses: actions-rs/cargo@v1
        with:
          command: clippy
          args: --manifest-path ./bindings/node/Cargo.toml --all-targets --all-features -- -D warnings

      - name: Lint TS
        working-directory: ./bindings/node
        run: yarn lint

      - name: Run JS tests
        working-directory: ./bindings/node
        run: make test