-
Notifications
You must be signed in to change notification settings - Fork 4
143 lines (114 loc) · 3.34 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
135
136
137
138
139
140
141
142
143
name: CI
on:
push:
branches:
- "**"
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: "buildwithfern"
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
WORKOS_API_KEY: ${{ secrets.WORKOS_API_KEY }}
WORKOS_CLIENT_ID: ${{ secrets.WORKOS_CLIENT_ID }}
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # This helps turbo resolve changes faster
- name: Install
uses: ./.github/actions/install
- name: Codegen
run: |
npm install -g fern-api
- name: Compile and build
run: pnpm turbo compile codegen build
env:
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
WORKOS_API_KEY: ${{ secrets.WORKOS_API_KEY }}
WORKOS_CLIENT_ID: ${{ secrets.WORKOS_CLIENT_ID }}
- name: Check dependencies
run: pnpm depcheck
- name: Check format
run: pnpm format:check
lint:
runs-on: CLI
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # This helps turbo resolve changes faster
- name: Install
uses: ./.github/actions/install
- name: Lint monorepo
run: pnpm lint:monorepo
- name: Lint style
run: pnpm turbo lint:style
- name: eslint
run: pnpm lint:eslint
visual-testing:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install
uses: ./.github/actions/install
- name: Run Chromatic
uses: chromaui/action@latest
# Chromatic CI config: https://www.chromatic.com/docs/github-actions/
with:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
workingDir: packages/ui/components
onlyChanged: true
fern-generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # This helps turbo resolve changes faster
- name: Install
uses: ./.github/actions/install
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: fernapi
password: ${{ secrets.FERN_API_DOCKERHUB_PASSWORD }}
- name: Codegen
run: |
pnpm fern generate --local --api fdr
pnpm turbo --filter=@fern-platform/fdr codegen
- name: Ensure no changes to git-tracked files
run: git --no-pager diff --exit-code
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # This helps turbo resolve changes faster
- name: Install
uses: ./.github/actions/install
- name: 🧪 Build generator-cli
run: |
pnpm turbo compile
pnpm --filter=@fern-api/generator-cli dist:cli
- name: Run tests
run: pnpm test
env:
CI: true
- name: Run tests against local FDR
run: |
cd servers/fdr
pnpm test:local
env:
CI: true
check-docs-release-is-allowed:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2 # This helps turbo resolve changes faster
- name: Install
uses: ./.github/actions/install
- name: Check release blockers
run: pnpm check-docs-release-blockers