Merge development branch #320
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: run unit tests | |
on: | |
pull_request: | |
branches: [main] | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
run-checks: | |
runs-on: ubuntu-20.04 | |
name: 'Run checks' | |
steps: | |
- name: check gclib version | |
run: ldd --version | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: cargo fmt --check | |
run: cargo fmt --check | |
- name: install dependencies | |
run: yarn install | |
- name: Check changefile | |
run: yarn check-changefile | |
- uses: actions/checkout@v4 | |
with: | |
components: clippy | |
- uses: giraffate/clippy-action@v1 | |
with: | |
reporter: 'github-pr-review' | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
clippy_flags: -- --all-targets -Dwarnings | |
tests-linux: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: napi build | |
run: yarn install && yarn build | |
- name: cargo test | |
run: cargo test --release | |
- name: Run cargo-udeps | |
uses: aig787/cargo-udeps-action@v1 | |
with: | |
version: 'latest' | |
args: '--all-targets' | |
- name: run napi tests | |
run: yarn test | |
- name: upload-artifacts | |
uses: actions/upload-artifact@v3 | |
if: needs.pr-check.outputs.number != 'null' | |
with: | |
name: linux-napi | |
path: ./*.node | |
if-no-files-found: error | |
- name: upload js files | |
uses: actions/upload-artifact@v3 | |
if: needs.pr-check.outputs.number != 'null' | |
with: | |
name: js-files | |
if-no-files-found: error | |
path: | | |
index.js | |
index.d.ts | |
tests-macos: | |
runs-on: macos-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: napi build --target x86_64-apple-darwin | |
run: yarn install && yarn build | |
- name: cat napi generated index file | |
run: cat ./index.js | |
- name: find built files | |
run: find . -name "*.node" | |
- name: run napi tests | |
run: yarn test | |
- name: cargo test | |
run: cargo test --release | |
- name: upload artifacts | |
uses: actions/upload-artifact@v3 | |
if: needs.pr-check.outputs.number != 'null' | |
with: | |
name: macos-napi | |
path: ./*.node | |
if-no-files-found: error | |
tests-macos-arm: | |
runs-on: macos-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: add rust target | |
run: rustup target add aarch64-apple-darwin | |
- name: napi build | |
run: yarn install && yarn build --target aarch64-apple-darwin | |
- name: cargo test | |
run: cargo test --release | |
- name: upload artifacts | |
uses: actions/upload-artifact@v3 | |
if: needs.pr-check.outputs.number != 'null' | |
with: | |
name: macos-arm-napi | |
path: ./*.node | |
if-no-files-found: error | |
tests-win: | |
runs-on: windows-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: napi build | |
run: yarn install && yarn build | |
- name: run napi tests | |
run: yarn test | |
- name: cargo test | |
run: cargo test --release | |
- name: upload artifacts | |
uses: actions/upload-artifact@v3 | |
if: needs.pr-check.outputs.number != 'null' | |
with: | |
name: windows-napi | |
path: ./*.node | |
if-no-files-found: error |