-
Notifications
You must be signed in to change notification settings - Fork 10
155 lines (139 loc) · 4.24 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
144
145
146
147
148
149
150
151
152
153
154
155
name: CI
# Inspiration:
# https://github.com/alexdiliberto/ember-transformicons/blob/master/.github/workflows/ci.yml
on:
pull_request:
push:
# filtering branches here prevents duplicate builds from pull_request and push
branches:
- master
- main
env:
CI: true
jobs:
install_dependencies:
name: Install Dependencies
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
#############################################################
lint:
name: Lint JS
runs-on: ubuntu-latest
needs: ['install_dependencies']
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- run: pnpm lint:js
lint_docs:
name: Lint Docs
runs-on: ubuntu-latest
needs: ['install_dependencies']
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- run: pnpm lint:docs
lint_readme:
name: README up to date
runs-on: ubuntu-latest
needs: ['install_dependencies']
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- run: pnpm run update && git diff --exit-code README.md docs/
#############################################################
tests:
name: Test
runs-on: ubuntu-latest
needs: ['install_dependencies']
strategy:
fail-fast: false
matrix:
node:
# pnpm 9 does not support < Node 18
# pnpm 8 does not support < Node 16
- { node: "14", pnpm: "6" }
# pnpm 9 does not support < Node 18
# pnpm 8 does not support < Node 16
- { node: "16", pnpm: "7" }
# pnpm 9 only supports node >= 18
- { node: "18", pnpm: "9" }
- { node: "20", pnpm: "9" }
- { node: "22", pnpm: "9" }
eslint:
- "eslint@9"
- "eslint@8"
- "eslint@7"
exclude:
- eslint: "eslint@9"
node: { node: "14", pnpm: "6" }
- eslint: "eslint@9"
node: { node: "16", pnpm: "7" }
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
with:
node-version: ${{ matrix.node.node }}
pnpm-version: ${{ matrix.node.pnpm }}
- name: "Use ${{ matrix.eslint }}"
run: |
pnpm remove eslint
pnpm add ${{ matrix.eslint }}
- name: Test with ${{ matrix.node.node }} & ${{ matrix.node.pnpm }}
run: |
echo "Matrix Info"
echo "Intended: node@${{ matrix.node.node }}, eslint@${{ matrix.eslint }}, pnpm@${{ matrix.node.pnpm }}"
echo "node: $(node -v)"
echo "pnpm: $(pnpm --version)"
echo "pnpm why eslint"
pnpm why eslint
pnpm test
smoke-tests:
name: ${{ matrix.script }}
runs-on: ubuntu-latest
needs: ['install_dependencies']
strategy:
fail-fast: false
matrix:
# tese are all relative to the smoke-tests directory
script:
- integration/position-default
- integration/flat-config
- integration/position-prettier
- integration/external-config-prettier
- examples/ember
- examples/typescript
- issue-reproductions/147
- issue-reproductions/195
- issue-reproductions/196
- issue-reproductions/289
- issue-reproductions/313
steps:
- uses: actions/checkout@v4
- uses: wyvox/action-setup-pnpm@v3
- run: ./scripts/smoke-test.sh smoke-tests/${{ matrix.script }}
# https://github.com/changesets/action
release:
name: Release
timeout-minutes: 5
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
needs:
- tests
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: wyvox/action-setup-pnpm@v3
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages
# and calls changeset publish
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}