Skip to content

Commit

Permalink
combine build and test
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Jun 6, 2024
1 parent ced5a0e commit a3df0bb
Showing 1 changed file with 5 additions and 33 deletions.
38 changes: 5 additions & 33 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ permissions:
pull_request: null

jobs:
build:
build-test:
strategy:
fail-fast: false
matrix:
Expand All @@ -33,7 +33,7 @@ jobs:
target: aarch64-apple-darwin
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
name: Build on ${{ matrix.settings.target }}
name: Build and test on ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -72,48 +72,20 @@ jobs:
npm run build --target ${{ matrix.settings.target }} &&
strip -x ${{ matrix.settings.target }}/*.node
shell: bash
- name: Test bindings
run: npm run test
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: ${{ matrix.settings.target }}/${{ env.APP_NAME }}.*.node
if-no-files-found: error

test:
name: Test on ${{ matrix.settings.target }}
needs:
- build
strategy:
matrix:
settings:
- host: macos-14-large
target: x86_64-apple-darwin
- host: macos-latest
target: aarch64-apple-darwin
- host: ubuntu-latest
target: x86_64-unknown-linux-gnu
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: bindings-${{ matrix.settings.target }}
path: .
- name: Test bindings
run: npm run test

publish:
name: Publish
runs-on: ubuntu-latest
needs:
- test
- build-test
steps:
- uses: actions/checkout@v4
- name: Setup node
Expand Down

0 comments on commit a3df0bb

Please sign in to comment.