-
Notifications
You must be signed in to change notification settings - Fork 136
156 lines (132 loc) ยท 3.81 KB
/
ci.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
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
156
name: CI
on:
push:
branches:
- master
- beta
pull_request:
jobs:
typecheck-outputs:
name: ๐ Typecheck Outputs / ${{ matrix.typescript-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
typescript-version:
- "~5.4.0"
- "~5.3.0"
- "~5.2.0"
# This is the current lowest version of typescript we support. Do not
# change this without bumping a major version. We support up to 4
# versions back from the latest version of typescript at time of a
# major release.
- "~5.1.0"
steps:
- name: โฌ๏ธ Checkout repo
uses: actions/checkout@v4
- name: โ Setup node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: ๐ฅ Download deps
uses: bahmutov/npm-install@v1
# Order is important here, we build with the typescript version defined
# in package.json, before we overrite it for the tests.
# TODO: We are rebuilding everything several times, our builds aren't very
# expensive, but we can easily optimize by caching the 'dist' directory
# once.
- name: ๐๏ธ Build
run: npm run build
- name: ๐ Install Typescript
run: npm install -D typescript@${{ matrix.typescript-version }}
- name: ๐ Type check
run: npm run typeCheck:dist
typecheck-source:
name: ๐ท Typecheck Source
runs-on: ubuntu-latest
steps:
- name: โฌ๏ธ Checkout repo
uses: actions/checkout@v4
- name: โ Setup node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: ๐ฅ Download deps
uses: bahmutov/npm-install@v1
- name: ๐ Type check
run: npm run typeCheck
test:
name: ๐งช Test [Node ${{ matrix.node }}]
runs-on: ubuntu-latest
strategy:
matrix:
node:
- 22
- 20
- 18
steps:
- name: โฌ๏ธ Checkout repo
uses: actions/checkout@v4
- name: โ Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: ๐ฅ Download deps
uses: bahmutov/npm-install@v1
- name: ๐งช Run tests
run: npm run test
lint:
name: ๐งน Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: ๐ฅ Download deps
uses: bahmutov/npm-install@v1
- name: Lint
run: npm run lint
prettier:
name: ๐ Formatting (prettier)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: ๐ฅ Download deps
uses: bahmutov/npm-install@v1
- name: Prettier
run: npm run prettier
publish:
needs:
- typecheck-source
- typecheck-outputs
- test
if: github.repository == 'remeda/remeda' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta')
runs-on: ubuntu-latest
steps:
- name: โฌ๏ธ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: โ Setup node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: ๐ฅ Download deps
uses: bahmutov/npm-install@v1
- name: ๐๏ธ Build
run: npm run build
- name: ๐ฎ Lint output
run: npm run lint:build
- name: ๐ Release
run: npm run release
env:
GH_TOKEN: ${{secrets.GH_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}