-
Notifications
You must be signed in to change notification settings - Fork 3
109 lines (102 loc) · 2.8 KB
/
build-onyx.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
name: Test Onyx Pipeline
on:
workflow_dispatch:
push:
branches:
- "test-onyx-caching"
jobs:
build-onyx:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: Setup go
uses: actions/setup-go@v5
with:
go-version: ">=1.20.0"
cache: true
- name: restore cache if exists
id: go-cache
uses: actions/cache/restore@v4
with:
path: |
onyx/bin
key: onyx-${{ hashFiles('onyx/**') }}
lookup-only: true
- if: ${{ steps.go-cache.outputs.cache-hit != 'true'}}
name: Build
working-directory: onyx
run: |
make setup
make build
- name: Save cache
uses: actions/cache/save@v4
with:
path: |
onyx/bin
key: onyx-${{ hashFiles('onyx/**') }}
build-typescript-apps:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- uses: actions/checkout@v4
- name: restore cache if exists
id: turbo-cache
uses: actions/cache/restore@v4
with:
path: yaku-apps-typescript/.turbo
key: typescript-apps-turbo-${{ hashFiles('yaku-apps-typescript/**') }}
lookup-only: true
- uses: actions/setup-node@v4
with:
node-version: 18
check-latest: true
cache: 'npm'
cache-dependency-path: yaku-apps-typescript/package-lock.json
- if: ${{ steps.turbo-cache.outputs.cache-hit != 'true'}}
name: Install and Build
working-directory: yaku-apps-typescript
run: |
npm ci -ws --include-workspace-root
npm run build
- name: Save cache
uses: actions/cache/save@v4
with:
path: |
yaku-apps-typescript/.turbo
key: typescript-apps-turbo-${{ hashFiles('yaku-apps-typescript/**') }}
test:
runs-on: ubuntu-latest
needs:
- build-onyx
- build-typescript-apps
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: restore onyx cache
uses: actions/cache/restore@v4
with:
path: |
onyx/bin
key: onyx-${{ hashFiles('onyx/**') }}
- name: Check
run: ls -ltr onyx/bin
- name: restore typescript-apps cache
uses: actions/cache/restore@v4
with:
path: |
yaku-apps-typescript/.turbo
key: typescript-apps-turbo-${{ hashFiles('yaku-apps-typescript/**') }}
- name: Check
run: ls -ltr yaku-apps-typescript/.turbo