Skip to content

Commit

Permalink
Run github actions for windows, macos, linux
Browse files Browse the repository at this point in the history
  • Loading branch information
recrsn committed Aug 16, 2023
1 parent 33043f5 commit 1969d96
Showing 1 changed file with 29 additions and 13 deletions.
42 changes: 29 additions & 13 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,50 @@ on:

jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
os: [ubuntu-20.04, macos-11.0, windows-2019]
nodeVersion: [14, 16, 18, 20]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.nodeVersion }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: |
sudo apt-get install -y python3 make g++
node-version: ${{ matrix.nodeVersion }}
- name: Test
run: npm test
- name: Package
if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master')
run: npx node-pre-gyp package
- name: Upload
uses: actions/upload-artifact@v3
if: matrix.nodeVersion == '14' && (startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master'))
with:
name: bcrypt-lib-${{ matrix.os }}-${{ matrix.nodeVersion }}
path: build/stage/**/bcrypt_lib*.tar.gz

build-alpine:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14, 16, 18]
nodeVersion: [14, 16, 18, 20]
container:
image: node:${{ matrix.node-version }}-alpine
image: node:${{ matrix.nodeVersion }}-alpine
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install dependencies
run: |
apk add make g++ python3
- name: Test
run: |
npm test --unsafe-perm
- name: Package
if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master')
run: npx node-pre-gyp package --unsafe-perm
- name: Upload
if: matrix.nodeVersion == '14' && (startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master'))
uses: actions/upload-artifact@v3
with:
name: bcrypt-lib-alpine-${{ matrix.nodeVersion }}
path: build/stage/**/bcrypt_lib*.tar.gz

0 comments on commit 1969d96

Please sign in to comment.