devcontainer.json: use slirp4netns to boot offline #375
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: build/test | |
on: | |
pull_request: | |
branches: [main] | |
workflow_call: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
checks: | |
strategy: | |
fail-fast: false | |
runs-on: ubuntu-20.04 | |
name: 'health checks' | |
steps: | |
- name: check gclib version | |
run: ldd --version | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: cargo fmt --check | |
run: cargo fmt --check | |
- name: install dependencies | |
run: yarn install | |
- name: Check changefile | |
run: yarn check-changefile | |
- uses: giraffate/clippy-action@v1 | |
with: | |
reporter: 'github-pr-review' | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
clippy_flags: -- --all-targets -Dwarnings | |
- name: Run cargo-udeps | |
uses: aig787/cargo-udeps-action@v1 | |
with: | |
version: 'latest' | |
args: '--all-targets' | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
settings: | |
- host: ubuntu-20.04 | |
target: x86_64-unknown-linux-gnu | |
test: true | |
js-files: true | |
- host: ubuntu-20.04 | |
target: aarch64-unknown-linux-gnu | |
packages: gcc-aarch64-linux-gnu | |
test: false | |
# This is the latest macos that github provides a non-enterprise-tier x86 | |
# runner for | |
# See: https://github.com/actions/runner-images?tab=readme-ov-file#available-images | |
- host: macos-13 | |
target: x86_64-apple-darwin | |
test: false | |
- host: macos-latest | |
target: aarch64-apple-darwin | |
test: false | |
- host: windows-latest | |
target: x86_64-pc-windows-msvc | |
test: true | |
- host: windows-latest | |
target: aarch64-pc-windows-msvc | |
test: false | |
name: build${{ matrix.settings.test && '+test' || ''}} ${{ matrix.settings.target }} on ${{ matrix.settings.host }} | |
runs-on: ${{ matrix.settings.host }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: nightly-2024-10-25 | |
targets: ${{ matrix.settings.target }} | |
- name: Cache cargo | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
.cargo-cache | |
target/ | |
key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }} | |
- name: run package install script | |
shell: bash | |
run: | | |
if [ -n "${{ matrix.settings.packages }}" ]; then | |
sudo apt-get update | |
sudo apt-get install -y ${{ matrix.settings.packages }} | |
fi | |
- name: napi build | |
run: yarn install && yarn build --target ${{ matrix.settings.target }} | |
- name: debug print machine info | |
run: | | |
find . -name "*.node"; | |
uname -a; | |
- name: run napi tests | |
if: ${{ matrix.settings.test }} | |
run: yarn test | |
- name: cargo test | |
if: ${{ matrix.settings.test }} | |
run: cargo test --release --tests | |
- name: upload-artifacts | |
uses: actions/upload-artifact@v4 | |
# only run when this subworkflow is called from CI (e.g. not a PR) | |
if: needs.pr-check.outputs.number != 'null' | |
with: | |
name: bindings-${{ matrix.settings.target }} | |
path: ./*.node | |
if-no-files-found: error | |
- name: upload js files | |
# only run when this subworkflow is called from CI (e.g. not a PR) | |
if: ${{ matrix.settings.js-files }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: js-files | |
if-no-files-found: error | |
path: | | |
index.js | |
index.d.ts |