-
Notifications
You must be signed in to change notification settings - Fork 3
134 lines (113 loc) · 3.5 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
name: CI
on:
pull_request:
push:
branches:
- '**'
tags-ignore:
- '**'
env:
CI: true
dist-cache-paths: |
packages/*/dist
packages/*/*/index.d.ts
packages/*/*/package.json
jobs:
skip_check:
name: Check concurrent runs
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- uses: fkirc/skip-duplicate-actions@v5
id: skip_check
with:
concurrent_skipping: same_content_newer
# We want to skip only concurrent runs. Subsequent runs/retries should be allowed.
skip_after_successful_duplicate: false
build:
name: Build
needs: skip_check
if: needs.skip_check.outputs.should_skip != 'true'
runs-on: ubuntu-latest
steps:
- name: Checkout & Install
uses: seek-oss/crackle/.github/actions/init@master
- name: Self build
run: pnpm build:ci
- name: Save build cache
uses: actions/cache/save@v4
with:
path: ${{ env.dist-cache-paths }}
key: build-${{ github.sha }}
enableCrossOsArchive: true
lint:
name: Lint
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout & Install
uses: seek-oss/crackle/.github/actions/init@master
- name: Restore build cache
uses: actions/cache/restore@v4
with:
path: ${{ env.dist-cache-paths }}
key: build-${{ github.sha }}
enableCrossOsArchive: true
- name: Run All Linters
run: pnpm lint
test:
name: Test
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout & Install
uses: seek-oss/crackle/.github/actions/init@master
- name: Restore build cache
uses: actions/cache/restore@v4
with:
path: ${{ env.dist-cache-paths }}
key: build-${{ github.sha }}
enableCrossOsArchive: true
- name: Cache browsers
id: browsers-cache
uses: actions/cache@v4
with:
path: /home/runner/.cache/ms-playwright
key: browsers-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml') }}
- name: Install browsers
if: steps.browsers-cache.outputs.cache-hit != 'true'
run: pnpm playwright install chromium
- name: Test
run: pnpm test
test-braid:
name: Test with Braid
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout & Install
uses: seek-oss/crackle/.github/actions/init@master
- name: Restore build cache
uses: actions/cache/restore@v4
with:
path: ${{ env.dist-cache-paths }}
key: build-${{ github.sha }}
enableCrossOsArchive: true
# First, clone the Braid repo so we have its lockfile
# We then cache/restore based on our lockfile *and* Braid's lockfile
# Then we install dependencies in Braid and run the test
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Clone Braid repo
run: pnpm fixtures:braid --clone --absorb
- name: Cache Braid dependencies
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: braid-${{ runner.os }}-${{ hashFiles('./pnpm-lock.yaml', './fixtures/braid-design-system/pnpm-lock.yaml') }}
- name: Install & Test
run: |
pnpm set verify-store-integrity false
pnpm test:braid