|
1 | 1 | name: CI |
2 | 2 |
|
3 | | -# Run CI when a PR is opened against the branch `main` |
4 | | -# and when one pushes a commit to `main`. |
5 | 3 | on: |
6 | 4 | push: |
7 | 5 | branches: [main] |
8 | 6 | pull_request: |
9 | 7 | branches: [main] |
10 | 8 |
|
11 | | -# Run CI on all 3 latest OSes |
| 9 | +permissions: |
| 10 | + contents: read |
| 11 | + |
12 | 12 | jobs: |
13 | 13 | build: |
14 | 14 | runs-on: ubuntu-latest |
15 | 15 |
|
16 | 16 | steps: |
17 | | - - uses: actions/checkout@v3 |
| 17 | + - uses: actions/checkout@v6 |
18 | 18 |
|
19 | 19 | - name: Set up Node toolchain |
20 | | - uses: actions/setup-node@v3 |
21 | | - with: |
22 | | - node-version: "16" |
23 | | - |
24 | | - - name: Cache NPM dependencies |
25 | | - uses: actions/cache@v3 |
26 | | - env: |
27 | | - cache-name: cache-node-modules |
| 20 | + uses: actions/setup-node@v6 |
28 | 21 | with: |
29 | | - path: ~/.npm |
30 | | - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package.json') }} |
31 | | - restore-keys: | |
32 | | - ${{ runner.os }}-build-${{ env.cache-name }}- |
33 | | - ${{ runner.os }}-build- |
34 | | - ${{ runner.os }}- |
| 22 | + node-version: "22" |
| 23 | + cache: npm |
35 | 24 |
|
36 | 25 | - name: Setup PureScript tooling |
37 | | - run: |
38 | | - npm i -g purescript@latest purs-tidy@latest purescript-psa@latest spago@next |
| 26 | + run: npm ci |
39 | 27 |
|
40 | 28 | - name: Cache PureScript dependencies |
41 | | - uses: actions/cache@v3 |
| 29 | + uses: actions/cache@v5 |
42 | 30 | with: |
43 | | - key: ${{ runner.os }}-spago-${{ hashFiles('**/spago.yml') }} |
| 31 | + key: ${{ runner.os }}-spago-${{ hashFiles('spago.yaml', 'spago.lock', 'package-lock.json') }} |
44 | 32 | path: | |
45 | 33 | .spago |
46 | 34 | output |
47 | 35 |
|
48 | | - # Compile the library/project |
49 | | - # censor-lib: ignore warnings emitted by dependencies |
50 | | - # strict: convert warnings into errors |
51 | | - # Note: `purs-args` actually forwards these args to `psa` |
52 | 36 | - name: Build the project |
53 | | - run: | |
54 | | - npx spago build |
| 37 | + run: npm run build |
55 | 38 |
|
56 | | - - name: Check Formatting |
57 | | - if: runner.os == 'Linux' |
58 | | - run: | |
59 | | - npx purs-tidy check src |
| 39 | + - name: Test |
| 40 | + run: npm test |
60 | 41 |
|
| 42 | + - name: Check Formatting |
| 43 | + run: npm run format:check |
0 commit comments