From 9a39dd4eba58d87d87feaee9e359130ffa7aa41b Mon Sep 17 00:00:00 2001 From: Liam Potter Date: Sun, 30 Nov 2025 22:36:32 +0000 Subject: [PATCH 01/10] simple matrix to test different versions of prettier --- .github/workflows/ci.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30e2753..b7b5388 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,13 +11,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: pnpm/action-setup@v4 with: run_install: false - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: node-version: '24' cache: 'pnpm' @@ -32,19 +32,22 @@ jobs: strategy: matrix: node-version: ['18', '20', '22', '24'] + 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'] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: pnpm/action-setup@v4 with: run_install: false - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} cache: 'pnpm' + - run: pnpm add -D prettier@${{ matrix.prettier-version }} + - run: pnpm install --frozen-lockfile - run: pnpm build From 7accb322ab8e88c74028ef6fe797137555a47198 Mon Sep 17 00:00:00 2001 From: Liam Potter Date: Sun, 30 Nov 2025 22:38:02 +0000 Subject: [PATCH 02/10] allow workspace root install --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b7b5388..b722378 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,7 +46,7 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'pnpm' - - run: pnpm add -D prettier@${{ matrix.prettier-version }} + - run: pnpm add -D prettier@${{ matrix.prettier-version }} -w - run: pnpm install --frozen-lockfile From 5e0990acabe92706cfc49fb95151340cbe44520c Mon Sep 17 00:00:00 2001 From: Liam Potter Date: Sun, 30 Nov 2025 22:39:55 +0000 Subject: [PATCH 03/10] split matrix --- .github/workflows/ci.yml | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b722378..2290651 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,6 @@ jobs: strategy: matrix: node-version: ['18', '20', '22', '24'] - 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'] steps: - uses: actions/checkout@v6 @@ -46,6 +45,32 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'pnpm' + - run: pnpm install --frozen-lockfile + + - run: pnpm build + + - run: pnpm test:all + + + test-prettier-versions: + runs-on: ubuntu-latest + + strategy: + matrix: + 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'] + + steps: + - uses: actions/checkout@v6 + + - uses: pnpm/action-setup@v4 + with: + run_install: false + + - uses: actions/setup-node@v6 + with: + node-version: '24' + cache: 'pnpm' + - run: pnpm add -D prettier@${{ matrix.prettier-version }} -w - run: pnpm install --frozen-lockfile From 5cebb2a00819867dab9ca8d41375555895d77903 Mon Sep 17 00:00:00 2001 From: Liam Potter Date: Sun, 30 Nov 2025 22:41:40 +0000 Subject: [PATCH 04/10] remove fail fast --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2290651..316794b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,6 +56,7 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: 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'] From aa3b30aef52400fd3b51efa61277235c21c6c71e Mon Sep 17 00:00:00 2001 From: Liam Potter Date: Sun, 30 Nov 2025 22:43:11 +0000 Subject: [PATCH 05/10] remove build from prettier scenarios, we don't care about type mismatches --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 316794b..2960e44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,6 +76,4 @@ jobs: - run: pnpm install --frozen-lockfile - - run: pnpm build - - - run: pnpm test:all + - run: pnpm test From 307e24e57a77442818634f140b446e1a181d38fb Mon Sep 17 00:00:00 2001 From: Liam Potter Date: Sun, 30 Nov 2025 22:44:43 +0000 Subject: [PATCH 06/10] try test all --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2960e44..ec6b637 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -76,4 +76,4 @@ jobs: - run: pnpm install --frozen-lockfile - - run: pnpm test + - run: pnpm test:all From 3c1f359dc0abe5794c71b6e2d19811585ba40ddd Mon Sep 17 00:00:00 2001 From: Liam Potter Date: Sun, 30 Nov 2025 22:45:34 +0000 Subject: [PATCH 07/10] add fail-fast to node tests --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec6b637..ee8c385 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,7 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: node-version: ['18', '20', '22', '24'] From 29574757ab6b442478a487574c2fbb5d49be8065 Mon Sep 17 00:00:00 2001 From: Liam Potter Date: Sun, 30 Nov 2025 22:45:50 +0000 Subject: [PATCH 08/10] remove test:all from prettier --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee8c385..547ad1c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,4 +77,4 @@ jobs: - run: pnpm install --frozen-lockfile - - run: pnpm test:all + - run: pnpm test From 411b224b6b55dc8631a3a97ba7d84bf43f1757d4 Mon Sep 17 00:00:00 2001 From: Liam Potter Date: Sun, 30 Nov 2025 22:48:20 +0000 Subject: [PATCH 09/10] add a nightly test against prettier@latest --- .github/workflows/nightly.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/nightly.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..9e8778d --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,28 @@ +name: Nightly Prettier Latest + +on: + schedule: + - cron: '0 2 * * *' # Runs at 02:00 UTC daily + workflow_dispatch: # Allows manual trigger + +jobs: + test-prettier-latest: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v6 + + - uses: pnpm/action-setup@v4 + with: + run_install: false + + - uses: actions/setup-node@v6 + with: + node-version: '24' + cache: 'pnpm' + + - run: pnpm add -D prettier@latest -w + + - run: pnpm install --frozen-lockfile + + - run: pnpm test From 53ddb1a74e56f3c9719c83ce4537d4678a3512bd Mon Sep 17 00:00:00 2001 From: Liam Potter Date: Sun, 30 Nov 2025 22:58:57 +0000 Subject: [PATCH 10/10] Make nightly open an issue if it fails --- .github/workflows/nightly.yml | 44 +++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 9e8778d..5221cdd 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -2,8 +2,8 @@ name: Nightly Prettier Latest on: schedule: - - cron: '0 2 * * *' # Runs at 02:00 UTC daily - workflow_dispatch: # Allows manual trigger + - cron: '0 2 * * *' + workflow_dispatch: jobs: test-prettier-latest: @@ -26,3 +26,43 @@ jobs: - run: pnpm install --frozen-lockfile - run: pnpm test + + - name: Create or comment on issue + if: failure() + uses: actions/github-script@v8 + with: + script: | + const issueTitle = 'Nightly Prettier Latest Test Failed'; + + // Search for existing open issue + const issues = await github.rest.issues.listForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + state: 'open', + labels: ['automated', 'test-failure'] + }); + + const existingIssue = issues.data.find(issue => issue.title === issueTitle); + + const body = `Test failed on run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + **Commit:** ${{ github.sha }} + **Date:** ${new Date().toISOString()}`; + + if (existingIssue) { + // Add comment to existing issue + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: existingIssue.number, + body: body + }); + } else { + // Create new issue + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title: issueTitle, + body: body, + labels: ['automated', 'test-failure'] + }); + }