-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 1.98 KB
/
sanity-build.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
name: Sanity Build
on: [pull_request]
jobs:
sanity-build:
strategy:
fail-fast: false
matrix:
apps: [frontend, server]
name: ${{ matrix.apps }} Sanity Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.1.34
- name: Install ${{ matrix.apps }} dependencies
shell: bash
env:
BUN_AUTH_TOKEN: ${{ secrets.READER_TOKEN }}
run: |
cd ${{ matrix.apps }}
echo -e "\n[install.scopes]\n\"@navikt\" = { token = \"$BUN_AUTH_TOKEN\", url = \"https://npm.pkg.github.com/\" }" >> bunfig.toml
bun install --frozen-lockfile
- name: Restore cache for ${{ matrix.apps }}
uses: actions/cache/restore@v4
with:
path: |
${{matrix.apps}}/.tsbuildinfo
key: ${{ matrix.apps }}-${{ github.ref_name }}-${{ hashFiles(format('{0}/tsconfig.json', matrix.apps)) }} # This will never hit, but it is required.
restore-keys: |
${{ matrix.apps }}-${{ github.ref_name }}-${{ hashFiles(format('{0}/tsconfig.json', matrix.apps)) }}
${{ matrix.apps }}-shared-${{ hashFiles(format('{0}/tsconfig.json', matrix.apps)) }}
- name: Typecheck ${{ matrix.apps }}
shell: bash
run: |
cd ${{ matrix.apps }}
bun run typecheck
- name: Lint ${{ matrix.apps }}
shell: bash
run: |
cd ${{ matrix.apps }}
npm run lint
- name: Test ${{ matrix.apps }}
shell: bash
run: |
cd ${{ matrix.apps }}
bun test
- name: Save cache for ${{ matrix.apps }}
uses: actions/cache/save@v4
if: always()
with:
path: |
${{matrix.apps}}/.tsbuildinfo
key: ${{ matrix.apps }}-${{ github.ref_name }}-${{ hashFiles(format('{0}/tsconfig.json', matrix.apps)) }}-${{ github.run_id }}