Skip to content

Commit e97cfc2

Browse files
Merge pull request #416 from ember-tooling/test-against-prettier-versions
Add matrix to test different versions of prettier
2 parents 7428fdc + 53ddb1a commit e97cfc2

File tree

2 files changed

+100
-4
lines changed

2 files changed

+100
-4
lines changed

.github/workflows/ci.yml

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v6
1515

1616
- uses: pnpm/action-setup@v4
1717
with:
1818
run_install: false
1919

20-
- uses: actions/setup-node@v4
20+
- uses: actions/setup-node@v6
2121
with:
2222
node-version: '24'
2323
cache: 'pnpm'
@@ -30,17 +30,18 @@ jobs:
3030
runs-on: ubuntu-latest
3131

3232
strategy:
33+
fail-fast: false
3334
matrix:
3435
node-version: ['18', '20', '22', '24']
3536

3637
steps:
37-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v6
3839

3940
- uses: pnpm/action-setup@v4
4041
with:
4142
run_install: false
4243

43-
- uses: actions/setup-node@v4
44+
- uses: actions/setup-node@v6
4445
with:
4546
node-version: ${{ matrix.node-version }}
4647
cache: 'pnpm'
@@ -50,3 +51,30 @@ jobs:
5051
- run: pnpm build
5152

5253
- run: pnpm test:all
54+
55+
56+
test-prettier-versions:
57+
runs-on: ubuntu-latest
58+
59+
strategy:
60+
fail-fast: false
61+
matrix:
62+
prettier-version: ['3.5.3', '3.6.0', '3.6.1', '3.6.2', '3.7.0', '3.7.1', '3.7.2', '3.7.3', 'latest']
63+
64+
steps:
65+
- uses: actions/checkout@v6
66+
67+
- uses: pnpm/action-setup@v4
68+
with:
69+
run_install: false
70+
71+
- uses: actions/setup-node@v6
72+
with:
73+
node-version: '24'
74+
cache: 'pnpm'
75+
76+
- run: pnpm add -D prettier@${{ matrix.prettier-version }} -w
77+
78+
- run: pnpm install --frozen-lockfile
79+
80+
- run: pnpm test

.github/workflows/nightly.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Nightly Prettier Latest
2+
3+
on:
4+
schedule:
5+
- cron: '0 2 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
test-prettier-latest:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v6
14+
15+
- uses: pnpm/action-setup@v4
16+
with:
17+
run_install: false
18+
19+
- uses: actions/setup-node@v6
20+
with:
21+
node-version: '24'
22+
cache: 'pnpm'
23+
24+
- run: pnpm add -D prettier@latest -w
25+
26+
- run: pnpm install --frozen-lockfile
27+
28+
- run: pnpm test
29+
30+
- name: Create or comment on issue
31+
if: failure()
32+
uses: actions/github-script@v8
33+
with:
34+
script: |
35+
const issueTitle = 'Nightly Prettier Latest Test Failed';
36+
37+
// Search for existing open issue
38+
const issues = await github.rest.issues.listForRepo({
39+
owner: context.repo.owner,
40+
repo: context.repo.repo,
41+
state: 'open',
42+
labels: ['automated', 'test-failure']
43+
});
44+
45+
const existingIssue = issues.data.find(issue => issue.title === issueTitle);
46+
47+
const body = `Test failed on run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
48+
**Commit:** ${{ github.sha }}
49+
**Date:** ${new Date().toISOString()}`;
50+
51+
if (existingIssue) {
52+
// Add comment to existing issue
53+
await github.rest.issues.createComment({
54+
owner: context.repo.owner,
55+
repo: context.repo.repo,
56+
issue_number: existingIssue.number,
57+
body: body
58+
});
59+
} else {
60+
// Create new issue
61+
await github.rest.issues.create({
62+
owner: context.repo.owner,
63+
repo: context.repo.repo,
64+
title: issueTitle,
65+
body: body,
66+
labels: ['automated', 'test-failure']
67+
});
68+
}

0 commit comments

Comments
 (0)