2020-10-14 17:15:20 +09:00
|
|
|
name: macOS/Windows/Linux x64
|
2020-02-18 22:09:17 +09:00
|
|
|
|
2020-10-15 17:14:11 +09:00
|
|
|
env:
|
|
|
|
DEBUG: 'napi:*'
|
2022-05-10 18:29:43 +09:00
|
|
|
RUST_BACKTRACE: 1
|
2020-10-15 17:14:11 +09:00
|
|
|
|
2023-03-12 19:31:13 +09:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-08-17 23:36:09 +09:00
|
|
|
on:
|
|
|
|
push:
|
2020-12-03 17:30:14 +09:00
|
|
|
branches:
|
|
|
|
- main
|
2020-08-17 23:36:09 +09:00
|
|
|
pull_request:
|
2020-02-18 22:09:17 +09:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_and_test:
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-04-06 12:04:53 +09:00
|
|
|
node: ['16', '18']
|
2020-07-29 23:04:47 +09:00
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2020-02-18 22:09:17 +09:00
|
|
|
|
2020-07-29 23:04:47 +09:00
|
|
|
name: stable - ${{ matrix.os }} - node@${{ matrix.node }}
|
|
|
|
runs-on: ${{ matrix.os }}
|
2020-02-18 22:09:17 +09:00
|
|
|
|
|
|
|
steps:
|
2022-04-01 15:29:51 +09:00
|
|
|
- uses: actions/checkout@v3
|
2020-05-06 00:13:23 +09:00
|
|
|
|
2020-02-18 22:09:17 +09:00
|
|
|
- name: Setup node
|
2022-03-05 15:14:32 +09:00
|
|
|
uses: actions/setup-node@v3
|
2020-02-18 22:09:17 +09:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node }}
|
2021-11-19 15:58:21 +09:00
|
|
|
cache: 'yarn'
|
2020-07-29 23:04:47 +09:00
|
|
|
|
|
|
|
- name: Install
|
2023-03-12 19:24:48 +09:00
|
|
|
uses: dtolnay/rust-toolchain@stable
|
2020-07-29 23:04:47 +09:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
|
2022-04-01 15:29:51 +09:00
|
|
|
- name: Cache cargo
|
|
|
|
uses: actions/cache@v3
|
2020-02-18 22:09:17 +09:00
|
|
|
with:
|
2022-04-01 15:29:51 +09:00
|
|
|
path: |
|
|
|
|
~/.cargo/registry
|
|
|
|
~/.cargo/git
|
2022-04-15 22:22:04 +09:00
|
|
|
target
|
2022-04-01 15:29:51 +09:00
|
|
|
key: stable-${{ matrix.os }}-node@${{ matrix.node }}-cargo-cache
|
2020-07-29 23:04:47 +09:00
|
|
|
|
|
|
|
- name: 'Install dependencies'
|
2022-04-01 15:29:51 +09:00
|
|
|
run: yarn install --mode=skip-build --immutable
|
2020-07-29 23:04:47 +09:00
|
|
|
|
2020-05-12 14:59:20 +09:00
|
|
|
- name: Check build
|
2023-04-09 00:37:28 +09:00
|
|
|
run: cargo check --all --bins --examples --tests -vvv
|
2020-02-18 22:09:17 +09:00
|
|
|
|
2020-06-17 21:33:28 +09:00
|
|
|
- name: Unit tests
|
2020-02-18 22:09:17 +09:00
|
|
|
run: |
|
2023-04-06 12:04:53 +09:00
|
|
|
yarn test:cli
|
2020-10-10 15:50:35 +09:00
|
|
|
yarn build:test
|
2022-03-05 15:14:32 +09:00
|
|
|
yarn test --verbose
|
2022-04-27 19:19:38 +09:00
|
|
|
yarn tsc -p examples/napi/tsconfig.json --noEmit
|
2022-05-21 14:53:40 +09:00
|
|
|
yarn test:macro
|
2022-05-10 18:29:43 +09:00
|
|
|
|
|
|
|
- name: Electron tests
|
|
|
|
if: matrix.os != 'ubuntu-latest'
|
|
|
|
run: |
|
|
|
|
node ./node_modules/electron/install.js
|
|
|
|
yarn test:electron
|
|
|
|
|
|
|
|
- name: Electron tests
|
|
|
|
if: matrix.os == 'ubuntu-latest'
|
|
|
|
run: |
|
|
|
|
node ./node_modules/electron/install.js
|
|
|
|
xvfb-run --auto-servernum yarn test:electron
|
2023-05-27 13:00:43 +09:00
|
|
|
|
|
|
|
- name: Test build with profile
|
|
|
|
run: yarn workspace @examples/napi build --profile napi-rs-custom
|