Skip to content

chore: refactor build #88

chore: refactor build

chore: refactor build #88

Workflow file for this run

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
node lib/esm.mjs
- name: running tests
run: |
node --test test/node.test.cjs
node --test test/node.test.mjs
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
bun lib/esm.mjs
- name: testing builded files
run: |
bun test test/bun.test.cjs
bun test test/bun.test.mjs
test_deno:
runs-on: ubuntu-20.04
needs: build
strategy:
matrix:
version: ["v1.x"]
steps:
- uses: actions/checkout@v4
- name: Run denoland/setup-deno@v1 (${{ matrix.version }})
uses: denoland/setup-deno@v1
with:
deno-version: ${{ matrix.version }}
- 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.mjs