chore: refactor build #85
Workflow file for this run
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: pull_request | |
on: | |
pull_request: | |
branches: | |
- master | |
- 1.9.x | |
- 1.8.x | |
- 1.7.x | |
- 1.6.x | |
- 1.5.x | |
- 1.4.x | |
- 1.3.x | |
- 1.2.x | |
- 1.1.x | |
- 1.0.x | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run actions/setup-node@v4 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: installing | |
run: npm ci | |
- name: setup | |
run: npm run setup | |
- name: testing wasm | |
run: npm run test:rs -- --node | |
- name: building | |
run: npm run build | |
- uses: actions/upload-artifact@master | |
with: | |
name: lib | |
path: lib/ | |
test_node: | |
runs-on: ubuntu-20.04 | |
needs: build | |
strategy: | |
matrix: | |
version: [20, 21] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run actions/setup-node@v4 (${{ matrix.version }}) | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.version }} | |
registry-url: https://registry.npmjs.org/ | |
- uses: actions/download-artifact@v4 | |
with: | |
name: lib | |
path: lib | |
- name: checking builded files | |
run: node lib/commonjs.cjs | |
- name: running tests | |
run: npm run test:ts | |
test_bun: | |
runs-on: ubuntu-20.04 | |
needs: build | |
strategy: | |
matrix: | |
version: [1.0, 1.1] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run oven-sh/setup-bun@v1 (${{ matrix.version }}) | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: ${{ matrix.version }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: lib | |
path: lib | |
- name: checking builded files | |
run: bun lib/commonjs.cjs | |
- name: testing builded files | |
run: bun test test/bun.test.js | |
test_deno: | |
runs-on: ubuntu-20.04 | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Run denoland/setup-deno@v1 (v1.x) | |
uses: denoland/setup-deno@v1 | |
with: | |
deno-version: v1.x | |
- uses: actions/download-artifact@v4 | |
with: | |
name: lib | |
path: lib | |
- name: checking builded files | |
run: deno run --allow-read=lib/rregex.wasm lib/mod.js | |
- name: testing builded files | |
run: deno test --allow-read=lib/rregex.wasm test/deno.test.js |