Skip to content

Commit

Permalink
Refactor CI pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Oct 7, 2024
1 parent 73ab588 commit 93e712d
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,21 @@ jobs:
strategy:
fail-fast: false
matrix:
targets:
[
'x86_64-apple-darwin',
'aarch64-apple-darwin',
'x86_64-unknown-linux-gnu',
'aarch64-unknown-linux-gnu',
'x86_64-unknown-linux-musl',
'aarch64-unknown-linux-musl',
'x86_64-pc-windows-msvc',
'aarch64-pc-windows-msvc',
]
runs-on: ubuntu-latest
name: Build - ${{ matrix.targets }} - node@20
settings:
- target: x86_64-apple-darwin
build: yarn build --target x86_64-apple-darwin
- target: aarch64-apple-darwin
build: yarn build --target aarch64-apple-darwin
- target: x86_64-unknown-linux-gnu
build: yarn build --target x86_64-unknown-linux-gnu --use-napi-cross
- target: aarch64-unknown-linux-gnu
build: yarn build --target aarch64-unknown-linux-gnu --use-napi-cross
- target: x86_64-pc-windows-msvc
build: yarn build --target x86_64-pc-windows-msvc
- target: aarch64-pc-windows-msvc
build: yarn build --target aarch64-pc-windows-msvc
runs-on: ubuntu-latest
name: Build - ${{ matrix.settings.target }} - node@20
steps:
- uses: actions/checkout@v4
- name: Cache cargo registry
Expand All @@ -48,19 +50,16 @@ jobs:
${{ github.workspace }}/.xwin
~/.napi-rs
./target
key: ${{ matrix.targets }}-cargo-cache
key: ${{ matrix.settings.target }}-cargo-cache
- name: Install
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.targets }}
targets: ${{ matrix.settings.target }}
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install multilib package
run: sudo apt install gcc-multilib
shell: bash
- name: Install ziglang
uses: mlugg/setup-zig@v1
with:
Expand All @@ -70,15 +69,15 @@ jobs:
env:
GITHUB_TOKEN: ${{ github.token }}
with:
tool: cargo-zigbuild,cargo-xwin
tool: cargo-zigbuild,cargo-xwin
- run: yarn install
- run: yarn build --target ${{ matrix.targets }}
- run: ${{ matrix.settings.build }}
env:
XWIN_CACHE_DIR: ${{ github.workspace }}/.xwin
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.targets }}
name: bindings-${{ matrix.settings.target }}
path: ${{ env.APP_NAME }}.*.node
if-no-files-found: error

Expand Down

0 comments on commit 93e712d

Please sign in to comment.