-
Notifications
You must be signed in to change notification settings - Fork 132
86 lines (71 loc) · 2.44 KB
/
build.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
name: build
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ${{ matrix.os }}
container: ${{ matrix.image }}
strategy:
matrix:
include:
- os: ubuntu-latest
- os: macOS-latest
- os: windows-latest
steps:
# We set LF endings so that the Windows environment is consistent with the rest
# See here for context: https://github.com/actions/checkout/issues/135
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
git config --global core.longpaths true
- uses: actions/checkout@v4
# NB: We install gnu-tar because BSD tar is buggy on Github's macos machines,
# and it breaks the cache: https://github.com/actions/cache/issues/403
- name: Install GNU tar (macOS)
if: runner.os == 'macOS'
run: |
brew install gnu-tar
echo "/usr/local/opt/gnu-tar/libexec/gnubin" >> $GITHUB_PATH
- name: Setup node and npm
uses: actions/setup-node@v4
with:
node-version: 22
- name: Cache NPM dependencies
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install global NPM packages
run: npm i --global [email protected] spago@next purs-tidy@latest esbuild@latest
- name: Cache PureScript dependencies
uses: actions/cache@v4
with:
key: ${{ runner.os }}-spago-${{ hashFiles('**/spago.yaml') }}
path: |
.spago
output
- name: Install NPM dependencies
run: npm ci
- name: Install PureScript dependencies
run: spago install
- name: Build the project
run: spago build
- name: Bootstrap executable
run: node ./bin/index.dev.js bundle -p spago-bin
- name: Bundle docs-search client
run: node ./bin/bundle.js bundle -p docs-search-client-halogen
- name: Run tests
run: node ./bin/bundle.js test
- name: Check formatting (Linux only)
if: matrix.os == 'ubuntu-latest'
run: npm run format:check