Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: setup github actions for tests #854

Merged
merged 1 commit into from
Dec 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Node.js CI

on: [push, pull_request]

jobs:
test:
strategy:
matrix:
node-version:
- node/10
- node/12
- node/14
- node/15
compiler:
- gcc
- clang
os:
- ubuntu-16.04 # ubuntu-18.04/ubuntu-latest missing package g++-4.9
- macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Install system dependencies
run: |
if [ "${{ matrix.compiler }}" = "gcc" -a "${{ matrix.os }}" = ubuntu-* ]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install g++-4.9
fi
- name: Use Node.js ${{ matrix.node-version }}
run: |
git clone --branch v1.4.2 --depth 1 https://github.com/jasongin/nvs ~/.nvs
. ~/.nvs/nvs.sh
nvs --version
nvs add ${{ matrix.node-version }}
nvs use ${{ matrix.node-version }}
node --version
npm --version
npm install
- name: npm test
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
export CC="gcc" CXX="g++"
fi
if [ "${{ matrix.compiler }}" = "gcc" -a "${{ matrix.os }}" = ubuntu-* ]; then
export CC="gcc-4.9" CXX="g++-4.9" AR="gcc-ar-4.9" RANLIB="gcc-ranlib-4.9" NM="gcc-nm-4.9"
fi
if [ "${{ matrix.compiler }}" = "clang" ]; then
export CC="clang" CXX="clang++"
fi
export CFLAGS="$CFLAGS -O3 --coverage" LDFLAGS="$LDFLAGS --coverage"
echo "CFLAGS=\"$CFLAGS\" LDFLAGS=\"$LDFLAGS\""
npm run pretest -- --verbose
node test
1 change: 1 addition & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [push, pull_request]

jobs:
lint:
if: github.repository == 'nodejs/node-addon-api'
strategy:
matrix:
node-version: [14.x]
Expand Down