-
-
Notifications
You must be signed in to change notification settings - Fork 87
155 lines (144 loc) · 4.32 KB
/
nodejs.yaml
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Node.js CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
env:
DISABLE_OPENCOLLECTIVE: true
- run: npm run lint
# - name: Run FOSSA scan and upload build data
# uses: fossa-contrib/fossa-action@v1
# with:
# fossa-api-key: ccf8289006445461c967cb7874f84a8a
- run: npm run build
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: build_artifacts
path: |
./dist
./lib
./es
test:
runs-on: ubuntu-latest
needs: [build]
strategy:
matrix:
node-version: [20, 22]
steps:
- uses: actions/checkout@v4
- name: Setup node 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
env:
DISABLE_OPENCOLLECTIVE: true
- name: Setup node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: npm run test
- run: npm run test:web
- run: npm run test:ramda
- run: npm run test:types
code_coverage:
if: github.ref == 'refs/heads/master' && github.actor != 'dependabot[bot]'
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
env:
DISABLE_OPENCOLLECTIVE: true
- name: Code coverage
run: npm run coverage
- name: Upload coverage report to codecov.io
if: github.ref == 'refs/heads/master'
uses: codecov/codecov-action@v4
with:
directory: ./coverage
flags: unittests
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload coverage artifacts
uses: actions/upload-artifact@v4
with:
name: coverage
path: |
./coverage
./test-results.xml
docs:
runs-on: ubuntu-latest
needs: [build, test, code_coverage]
if: github.ref == 'refs/heads/master' && github.actor != 'dependabot[bot]'
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
uses: actions/setup-node@v4
with:
node-version: 22
- name: Cache Node Modules
id: cache-node-modules
uses: actions/cache@v4
with:
path: node_modules
key: node-modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: npm ci
env:
DISABLE_OPENCOLLECTIVE: true
- run: npm run build:umd
- run: npm run docs
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: docs/ramda-adjunct # The folder the action should deploy.
CLEAN: false # Automatically remove deleted files from the deploy branch
- name: Upload docs artifact
uses: actions/upload-artifact@v4
with:
name: docs
path: ./docs