-
Notifications
You must be signed in to change notification settings - Fork 2
80 lines (69 loc) · 2.5 KB
/
node.js.yml
File metadata and controls
80 lines (69 loc) · 2.5 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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [14.x, 16.x, 18.x, 20.x, 22.x, 24.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v3
- name: Install libpostal
run: bash ${GITHUB_WORKSPACE}/.github/workflows/install-libpostal.sh
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- name: Install dependencies (Node.js >= 22)
if: ${{ matrix.node-version == '22.x' || matrix.node-version == '24.x' }}
env:
CXXFLAGS: "-I/deps/include"
LDFLAGS: "-L/deps/lib"
run: yarn run ci:install
- name: Install dependencies (Node.js < 22) - Skip @ezs/storage
if: ${{ matrix.node-version != '22.x' && matrix.node-version != '24.x' }}
env:
CXXFLAGS: "-I/deps/include"
LDFLAGS: "-L/deps/lib"
run: |
# Temporarily move storage package outside packages/ to exclude it from workspaces glob
mv packages/storage disabled-packages-storage
yarn ci:install
# Restore storage package location
mv disabled-packages-storage packages/storage
- name: Rebuild node-postal (Mainly use to NodeJS 20)
env:
CXXFLAGS: "-I/deps/include"
LDFLAGS: "-L/deps/lib"
run: |
cd node_modules/node-postal
yarn run install
- name: Testing all packages
env:
LD_LIBRARY_PATH: "/deps/lib"
DEBUG: "ezs:error,ezs:warn"
run: yarn run ci:test
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
flag-name: run-${{ matrix.node-version }}
parallel: true
finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true