-
Notifications
You must be signed in to change notification settings - Fork 0
99 lines (92 loc) · 2.67 KB
/
node.yaml
File metadata and controls
99 lines (92 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Build
on:
push:
# tags:
# - v*
env:
NAPI_VERSION: 7
BINDING_NAME: ltc-wrapper
jobs:
build-and-test:
name: Build ${{ matrix.arch }} on ${{ matrix.os }} ${{ matrix.libc }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# macos
- os: macos-11
arch: arm64
is-native: false
- os: macos-11
arch: x64
is-native: true
- os: macos-10.15
arch: x64
is-native: true
# linux
- os: ubuntu-18.04
arch: x64
is-native: true
# linux-arm
- os: ubuntu-latest
arch: arm64
is-native: false
docker-arch: linux/arm64
docker-image: node:14-buster
- os: ubuntu-latest
arch: arm
is-native: false
docker-arch: linux/arm/v7
docker-image: node:14-buster
steps:
- uses: actions/checkout@v2
- name: Checkout submodules
shell: bash
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y build-essential
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- name: rebuild
if: ${{ !matrix.docker-arch }}
shell: bash
run: |
yarn
if [ -n "${{ matrix.is-native }}" ]; then
yarn test
fi
env:
CI: true
npm_config_build_from_source: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: matrix.docker-arch
- name: rebuild (in docker)
uses: addnab/docker-run-action@v3
if: matrix.docker-arch
with:
image: ${{ matrix.docker-image }}
# shell: bash
options: --platform=${{ matrix.docker-arch }} -v ${{ github.workspace }}:/work -e CI=1 -e npm_config_build_from_source=1 -e NAPI_VERSION -e BINDING_NAME
run: |
if command -v apt-get &> /dev/null
then
apt-get update
apt-get install -y build-essential
elif command -v apk &> /dev/null
then
apk update
apk add cmake make g++ gcc libltc
fi
cd /work
yarn
yarn test