-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (69 loc) · 2.1 KB
/
node.js.yml
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
name: Node.js CI
on: [pull_request]
jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
# os: [ubuntu-latest, windows-latest]
node-version: [16.x]
r-version: [4.1.x]
python-version: [3.x]
steps:
# -----------------------
# SETUP -----------------
# -----------------------
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
# Ubuntu specific
- name: Install curl
if: startsWith(matrix.os, 'ubuntu')
run: sudo apt update && sudo apt install libcurl4-openssl-dev
# Node
- name: Setup Node.js v${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install node modules
run: npm install
# Typescript
- name: Check types
if: startsWith(matrix.os, 'ubuntu')
run: npm run check-types
# R
- name: Setup R v${{ matrix.r-version }}
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r-version }}
- name: Cache Renv packages
uses: r-lib/actions/setup-renv@v2
# - name: Renv snapshot
# run: Rscript -e "renv::snapshot()"
# Python
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
# Build release
- name: Build release
run: npm run build-release
- name: Link release
run: npm link ./release
# -----------------------
# TEST ------------------
# -----------------------
- name: Run tests
run: npm run test
# -----------------------
# WRAP UP ---------------
# -----------------------
- name: Upload artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@main
with:
name: ${{ matrix.os }}-node${{ matrix.node-version }}-r${{ matrix.r-version }}-python${{ matrix.python-version }}-results
path: check