-
Notifications
You must be signed in to change notification settings - Fork 5
158 lines (123 loc) · 4.68 KB
/
continuous-deployment.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
name: Continuous Deployment
on:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
env:
NUMBER_OF_RUNNERS: 8
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout default branch
uses: actions/checkout@v4
- name: Use pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install npm dependencies
run: pnpm i --frozen-lockfile
- name: Generate icons
run: pnpm --stream --filter {packages/fondue} generate:icons && pnpm --stream --filter {packages/fondue} generate:componentsEnum
- name: Lint code
run: pnpm lint
typecheck:
name: Typecheck
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout default branch
uses: actions/checkout@v4
- name: Use pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install npm dependencies
run: pnpm i --frozen-lockfile
- name: Generate icons
run: pnpm --stream --filter {packages/fondue} generate:icons && pnpm --stream --filter {packages/fondue} generate:componentsEnum
- name: Typecheck code
run: pnpm typecheck
component-tests:
name: Component Tests
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
containers: [0, 1, 2, 3, 4, 5, 6, 7]
steps:
- name: Checkout current commit
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
- name: Use pnpm
uses: pnpm/[email protected]
with:
version: latest
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
id: npm_cache
with:
path: |
${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
~/.cache/Cypress
key: pnpm-with-cypress-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: pnpm-with-cypress-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Generate icons
run: pnpm --stream --filter {packages/fondue} generate:icons && pnpm --stream --filter {packages/fondue} generate:componentsEnum
- name: Component Tests
run: pnpm run --stream --filter {packages/fondue} test --spec $(node ./.github/lib/cypress-matrix.mjs ${{ env.NUMBER_OF_RUNNERS }} ${{ matrix.containers }})
publish:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [lint, typecheck, component-tests]
permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
steps:
- name: Checkout default branch
uses: actions/checkout@v4
- name: Use pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'pnpm'
- name: Install npm dependencies
run: pnpm i --frozen-lockfile
- name: Create release PR or publish to npm
id: changesets
uses: changesets/action@v1
with:
commit: 'chore: release packages'
title: 'chore: release packages'
version: pnpm ci:version
publish: pnpm ci:publish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}