mirror of
https://github.com/napi-rs/napi-rs.git
synced 2026-02-01 16:41:24 +00:00
ci: use shell to run tests in Docker (#2175)
This commit is contained in:
parent
349996b699
commit
45a404c30b
89
.github/workflows/test-release.yaml
vendored
89
.github/workflows/test-release.yaml
vendored
@ -188,49 +188,48 @@ jobs:
|
||||
run: yarn workspace @examples/napi build --profile napi-rs-custom
|
||||
|
||||
build-and-test-msys2:
|
||||
strategy:
|
||||
matrix:
|
||||
sys: [MINGW64, UCRT64,CLANG64]
|
||||
runs-on: windows-latest
|
||||
strategy:
|
||||
matrix:
|
||||
sys: [MINGW64, UCRT64, CLANG64]
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ matrix.sys }}
|
||||
update: true
|
||||
install: >-
|
||||
base-devel
|
||||
pacboy: >-
|
||||
rust:p
|
||||
yarn:p
|
||||
${{ matrix.sys == 'CLANG64' && 'gcc-compat:p' || '' }}
|
||||
- name: Setup MSYS2
|
||||
uses: msys2/setup-msys2@v2
|
||||
with:
|
||||
msystem: ${{ matrix.sys }}
|
||||
update: true
|
||||
install: >-
|
||||
base-devel
|
||||
pacboy: >-
|
||||
rust:p
|
||||
yarn:p
|
||||
${{ matrix.sys == 'CLANG64' && 'gcc-compat:p' || '' }}
|
||||
|
||||
- name: Cargo test
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cargo test
|
||||
# Because dependencies use napi-rs itself they use older versions of napi-rs to install the package, this will fail automatically during build, uncomment when bootstrap issues have been solved
|
||||
# - name: Install dependencies
|
||||
# shell: msys2 {0}
|
||||
# run: |
|
||||
# yarn install --immutable --mode=skip-build
|
||||
#
|
||||
# - name: Build tests
|
||||
# shell: msys2 {0}
|
||||
# run: yarn build:test
|
||||
#
|
||||
# - name: Run tests
|
||||
# shell: msys2 {0}
|
||||
# run: |
|
||||
# yarn test:cli
|
||||
# yarn test --verbose
|
||||
# yarn tsc -p examples/napi/tsconfig.json --noEmit --skipLibCheck
|
||||
# yarn test:macro
|
||||
- name: Cargo test
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
cargo test
|
||||
# Because dependencies use napi-rs itself they use older versions of napi-rs to install the package, this will fail automatically during build, uncomment when bootstrap issues have been solved
|
||||
# - name: Install dependencies
|
||||
# shell: msys2 {0}
|
||||
# run: |
|
||||
# yarn install --immutable --mode=skip-build
|
||||
#
|
||||
# - name: Build tests
|
||||
# shell: msys2 {0}
|
||||
# run: yarn build:test
|
||||
#
|
||||
# - name: Run tests
|
||||
# shell: msys2 {0}
|
||||
# run: |
|
||||
# yarn test:cli
|
||||
# yarn test --verbose
|
||||
# yarn tsc -p examples/napi/tsconfig.json --noEmit --skipLibCheck
|
||||
# yarn test:macro
|
||||
|
||||
|
||||
build_only:
|
||||
name: Build only test - ${{ matrix.settings.target }}
|
||||
runs-on: ${{ matrix.settings.host }}
|
||||
@ -481,16 +480,8 @@ jobs:
|
||||
id: image-name
|
||||
run: |
|
||||
node -e "console.info('docker-image=${{ matrix.settings.image }}'.replace('{:version}', ${{ matrix.node }}))" >> "$GITHUB_OUTPUT"
|
||||
- name: Setup and run tests
|
||||
uses: addnab/docker-run-action@v3
|
||||
with:
|
||||
image: ${{ steps.image-name.outputs.docker-image }}
|
||||
options: ${{ matrix.settings.args }} -v ${{ github.workspace }}/cores:/cores -v ${{ github.workspace }}:/build -w /build
|
||||
run: yarn test
|
||||
- name: List files
|
||||
run: |
|
||||
ls -la .
|
||||
ls -la ./cores
|
||||
- name: Run test
|
||||
run: docker run --rm ${{ matrix.settings.args }} -v ${{ github.workspace }}:/build -w /build ${{ steps.image-name.outputs.docker-image }} sh -c "yarn workspace @examples/napi test"
|
||||
|
||||
build-and-test-linux-armv7:
|
||||
name: stable - armv7-unknown-linux-gnueabihf - node@20
|
||||
|
||||
@ -12,17 +12,17 @@ const t =
|
||||
// aarch64-unknown-linux-gnu is extremely slow in CI, skip it or it will timeout
|
||||
process.arch === 'arm64' && process.platform === 'linux' ? test.skip : test
|
||||
|
||||
const concurrency = process.env.WASI_TEST
|
||||
? 1
|
||||
: process.platform === 'win32' ||
|
||||
process.platform === 'darwin' ||
|
||||
(process.platform === 'linux' &&
|
||||
process.arch === 'x64' &&
|
||||
// @ts-expect-error
|
||||
process?.report?.getReport()?.header?.glibcVersionRuntime &&
|
||||
!process.env.ASAN_OPTIONS)
|
||||
const concurrency =
|
||||
process.platform === 'win32' ||
|
||||
process.platform === 'darwin' ||
|
||||
(process.platform === 'linux' &&
|
||||
process.arch === 'x64' &&
|
||||
// @ts-expect-error
|
||||
process?.report?.getReport()?.header?.glibcVersionRuntime &&
|
||||
!process.env.ASAN_OPTIONS &&
|
||||
!process.env.WASI_TEST)
|
||||
? 20
|
||||
: 3
|
||||
: 1
|
||||
|
||||
t('should be able to require in worker thread', async (t) => {
|
||||
await Promise.all(
|
||||
|
||||
@ -28,7 +28,7 @@
|
||||
"format:rs": "cargo fmt",
|
||||
"format:toml": "taplo format",
|
||||
"lint": "oxlint --import-plugin --ignore-path=./.oxlintignore --deny-warnings -c oxlint.json",
|
||||
"test": "yarn workspaces foreach -A --exclude \"{cli,napi-rs}\" run test",
|
||||
"test": "yarn workspaces foreach -j 1 -A --exclude \"{cli,napi-rs}\" run test",
|
||||
"test:bun": "bun test examples/napi/__tests__/values.spec.ts",
|
||||
"test:cli": "yarn workspace @napi-rs/cli test",
|
||||
"test:electron": "electron examples/napi/electron.cjs",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user