diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30e2753..547ad1c 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' @@ -30,17 +30,18 @@ jobs: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: node-version: ['18', '20', '22', '24'] 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' @@ -50,3 +51,30 @@ jobs: - run: pnpm build - run: pnpm test:all + + + test-prettier-versions: + 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'] + + 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 + + - run: pnpm test diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000..5221cdd --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,68 @@ +name: Nightly Prettier Latest + +on: + schedule: + - cron: '0 2 * * *' + workflow_dispatch: + +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 + + - 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'] + }); + }