ci: update actions/cache to v4 #9
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: Tests | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| name: Test on Node ${{ matrix.node-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [16.x, 18.x, 20.x] | |
| fail-fast: false | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Debug - List submodules | |
| run: | | |
| git submodule status | |
| ls -la | |
| ls -la cel-rust/ | |
| ls -la cel-rust/interpreter/ | |
| shell: bash | |
| - name: Use Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| - name: Cache NPM dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: node_modules | |
| key: npm-cache-test-${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('package-lock.json') }} | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: x86_64-unknown-linux-gnu | |
| - name: Cache cargo | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| .cargo-cache | |
| target/ | |
| key: cargo-test-${{ runner.os }}-${{ matrix.node-version }} | |
| - name: Build native module | |
| run: npx @napi-rs/cli build --target x86_64-unknown-linux-gnu | |
| - name: Run tests | |
| run: npm test |