-
Notifications
You must be signed in to change notification settings - Fork 13
81 lines (78 loc) · 2.21 KB
/
ci.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: CI
on:
push:
env:
TURBO_TOKEN: ${{secrets.TURBO_TOKEN}}
TURBO_TEAM: ${{vars.TURBO_TEAM}}
jobs:
gen:
name: Check generated code
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup requirements
uses: ./.github/actions/setup
- name: Re-generate code
run: pnpm gen
- name: Check for uncommitted changes
id: changes
uses: UnicornGlobal/[email protected]
- name: Fail if uncommitted changes
if: steps.changes.outputs.changed == 1
run: exit 1
lint:
name: Lint packages
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup requirements
uses: ./.github/actions/setup
- name: Lint packages
run: pnpm lint
- name: Check for uncommitted changes
id: changes
uses: UnicornGlobal/[email protected]
- name: Fail if uncommitted changes
if: steps.changes.outputs.changed == 1
run: exit 1
test:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup requirements
uses: ./.github/actions/setup
- name: Run tests
run: pnpm test
test-e2e:
name: Run e2e tests
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup requirements
uses: ./.github/actions/setup
- name: Run e2e tests
run: pnpm test:e2e
release:
name: Release packages
if: github.event_name == 'push' && github.ref_name == 'main'
runs-on: ubuntu-latest
needs: [gen, lint, test, test-e2e]
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup requirements
uses: ./.github/actions/setup
- name: Release packages
uses: changesets/action@v1
with:
publish: pnpm release
commit: 'chore(release): version packages'
title: 'chore(release): version packages'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}