Skip to content

Commit 44779dc

Browse files
authored
Revert "chore: update linters and ci (#1065)" (#1066)
This reverts commit 7302136.
1 parent 7302136 commit 44779dc

26 files changed

+3543
-967
lines changed

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* text=auto eol=lf
2+
*.lockb binary diff=lockb

.github/workflows/autofix.yml

-47
This file was deleted.

.github/workflows/e2e.yml

+62-30
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ name: E2E Test
22

33
on:
44
pull_request:
5-
branches:
6-
- main
75
workflow_call:
86
workflow_dispatch:
97
schedule:
10-
- cron: "0 0 * * SUN"
8+
- cron: '0 0 * * SUN'
119

1210
permissions: {}
1311

@@ -28,22 +26,27 @@ jobs:
2826
steps:
2927
- name: Checkout
3028
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31-
with:
32-
persist-credentials: false
3329

3430
- name: Install mise
3531
uses: jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8 # v2.1.11
3632
with:
37-
version: 2025.1.0
38-
cache_save: ${{ github.ref_name == 'main' }}
39-
env:
40-
GITHUB_TOKEN: ${{ github.token }}
33+
experimental: true
34+
install: false
35+
36+
- name: Install mise tools
37+
# cspell:ignore reshim
38+
# reshim is required to avoid "No such file or directory" error
39+
# ref: https://github.com/jdx/mise/issues/2260
40+
run: mise install || (mise reshim && mise install)
41+
42+
- name: Install package.json dependencies
43+
run: mise run buni
4144

4245
- name: List astro versions for E2E tests
4346
id: list
4447
run: |
45-
versions=$(mise run test:list-astro-versions)
46-
echo "versions=${versions}" >> "${GITHUB_OUTPUT}"
48+
versions=$(bun run .github/workflows/scripts/list-astro-versions.ts)
49+
echo "versions=$versions" >> "$GITHUB_OUTPUT"
4750
4851
test-e2e-general:
4952
needs:
@@ -63,16 +66,21 @@ jobs:
6366
steps:
6467
- name: Checkout
6568
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
66-
with:
67-
persist-credentials: false
6869

6970
- name: Install mise
7071
uses: jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8 # v2.1.11
7172
with:
72-
version: 2025.1.0
73-
cache_save: ${{ github.ref_name == 'main' }}
74-
env:
75-
GITHUB_TOKEN: ${{ github.token }}
73+
experimental: true
74+
install: false
75+
76+
- name: Install mise tools
77+
# cspell:ignore reshim
78+
# reshim is required to avoid "No such file or directory" error
79+
# ref: https://github.com/jdx/mise/issues/2260
80+
run: mise install || (mise reshim && mise install)
81+
82+
- name: Install package.json dependencies
83+
run: mise run buni
7684

7785
- name: Build Package
7886
run: mise run build
@@ -89,7 +97,7 @@ jobs:
8997
id: dependency-versions
9098
run: |
9199
playwright_version=$(bun pm ls | sed -nE 's/.*@playwright\/test@(.+)/\1/p')
92-
echo "playwright=${playwright_version}" >> "${GITHUB_OUTPUT}"
100+
echo "playwright=$playwright_version" >> "$GITHUB_OUTPUT"
93101
94102
- name: Restore Playwright Browsers Cache
95103
id: restore-browsers-cache
@@ -136,16 +144,21 @@ jobs:
136144
steps:
137145
- name: Checkout
138146
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
139-
with:
140-
persist-credentials: false
141147

142148
- name: Install mise
143149
uses: jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8 # v2.1.11
144150
with:
145-
version: 2025.1.0
146-
cache_save: ${{ github.ref_name == 'main' }}
147-
env:
148-
GITHUB_TOKEN: ${{ github.token }}
151+
experimental: true
152+
install: false
153+
154+
- name: Install mise tools
155+
# cspell:ignore reshim
156+
# reshim is required to avoid "No such file or directory" error
157+
# ref: https://github.com/jdx/mise/issues/2260
158+
run: mise install || (mise reshim && mise install)
159+
160+
- name: Install package.json dependencies
161+
run: mise run buni
149162

150163
- name: Build Package
151164
run: mise run build
@@ -156,12 +169,12 @@ jobs:
156169
playwright_version=$(bun pm ls | sed -nE 's/.*@playwright\/test@(.+)/\1/p')
157170
astro_version=$(bun pm ls | sed -nE 's/.*astro@(.+)/\1/p' | uniq)
158171
# throw error if several versions are found
159-
if [[ $(echo "${astro_version}" | wc -l) -gt 1 ]]; then
160-
echo "Multiple versions of Astro found: ${astro_version}"
172+
if [[ $(echo "$astro_version" | wc -l) -gt 1 ]]; then
173+
echo "Multiple versions of Astro found: $astro_version"
161174
exit 1
162175
fi
163-
echo "playwright=${playwright_version}" >> "${GITHUB_OUTPUT}"
164-
echo "astro=${astro_version}" >> "${GITHUB_OUTPUT}"
176+
echo "playwright=$playwright_version" >> "$GITHUB_OUTPUT"
177+
echo "astro=$astro_version" >> "$GITHUB_OUTPUT"
165178
166179
- name: Restore Playwright Browsers Cache
167180
id: restore-browsers-cache
@@ -188,7 +201,7 @@ jobs:
188201

189202
- name: Store Hash of E2E Test Fixtures and Image Service Consistency Test
190203
id: fixtures-hash
191-
run: echo "hash=${{ hashFiles('tests/e2e/fixtures/**/*', 'tests/e2e/conversion.test.ts') }}" >> "${GITHUB_OUTPUT}"
204+
run: echo "hash=${{ hashFiles('tests/e2e/fixtures/**/*', 'tests/e2e/conversion.test.ts') }}" >> "$GITHUB_OUTPUT"
192205

193206
- name: Install E2E Test Fixtures Dependencies
194207
run: bun install --frozen-lockfile
@@ -238,13 +251,32 @@ jobs:
238251
name: playwright-report-conversion-${{ github.sha }}
239252
path: playwright-report/
240253

241-
actions-timeline:
254+
test-e2e-status:
242255
needs:
243256
- test-e2e-general
244257
- test-e2e-conversion
258+
245259
# skip if the workflow is called from another workflow
246260
if: ${{ !cancelled() && contains(github.workflow_ref, '/e2e.yml') }}
247261

262+
runs-on: ubuntu-24.04
263+
timeout-minutes: 5
264+
265+
steps:
266+
- name: Check the status of the jobs
267+
run: |
268+
if [[ $(echo '${{ toJson(needs.*.result) }}' | jq 'all(. == "success")') == "false" ]]; then
269+
echo 'Some jobs are failed, cancelled, or skipped.'
270+
exit 1
271+
fi
272+
echo 'All jobs are successful.'
273+
274+
actions-timeline:
275+
needs:
276+
- test-e2e-status
277+
278+
if: needs.test-e2e-status.result == 'success' || needs.test-e2e-status.result == 'failure'
279+
248280
runs-on: ubuntu-24.04
249281
timeout-minutes: 5
250282
permissions:

.github/workflows/lint.yml

+61-31
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ name: Lint
22

33
on:
44
pull_request:
5-
branches:
6-
- main
75
workflow_call:
86
workflow_dispatch:
97
schedule:
10-
- cron: "0 0 * * SUN"
8+
- cron: '0 0 * * SUN'
119

1210
permissions: {}
1311

@@ -28,24 +26,27 @@ jobs:
2826
steps:
2927
- name: Checkout
3028
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31-
with:
32-
persist-credentials: false
3329

3430
- name: Install mise
3531
uses: jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8 # v2.1.11
3632
with:
37-
version: 2025.1.0
38-
cache_save: ${{ github.ref_name == 'main' }}
39-
env:
40-
GITHUB_TOKEN: ${{ github.token }}
33+
experimental: true
34+
install: false
35+
36+
- name: Install mise tools
37+
# cspell:ignore reshim
38+
# reshim is required to avoid "No such file or directory" error
39+
# ref: https://github.com/jdx/mise/issues/2260
40+
run: mise install || (mise reshim && mise install)
41+
42+
- name: Install package.json dependencies
43+
run: mise run buni
4144

4245
- name: List mise tasks
4346
id: list
4447
run: |
45-
tasks=$(mise tasks ls --json \
46-
| jq --raw-output --compact-output \
47-
'map(select(.name | test("^check:")) | {name: (.name | sub("^.+:" ; "")), task: .name})')
48-
echo "tasks=${tasks}" >> "${GITHUB_OUTPUT}"
48+
tasks=$(bun run .github/workflows/scripts/list-mise-tasks.ts)
49+
echo "tasks=$tasks" >> "$GITHUB_OUTPUT"
4950
5051
lint:
5152
needs: list-tasks
@@ -55,7 +56,7 @@ jobs:
5556
permissions:
5657
contents: read # for checkout
5758

58-
name: ${{ matrix.name }}
59+
name: lint-${{ matrix.name }}
5960
strategy:
6061
fail-fast: false
6162
matrix:
@@ -66,23 +67,30 @@ jobs:
6667
steps:
6768
- name: Checkout
6869
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
69-
with:
70-
persist-credentials: false
7170

7271
- name: Install mise
7372
uses: jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8 # v2.1.11
7473
with:
75-
version: 2025.1.0
76-
cache_save: ${{ github.ref_name == 'main' }}
77-
env:
78-
GITHUB_TOKEN: ${{ github.token }}
74+
experimental: true
75+
install: false
76+
77+
- name: Install mise tools
78+
# cspell:ignore reshim
79+
# reshim is required to avoid "No such file or directory" error
80+
# ref: https://github.com/jdx/mise/issues/2260
81+
run: mise install || (mise reshim && mise install)
82+
83+
- name: Install mise tools
84+
run: mise install --verbose
85+
86+
- name: Install package.json dependencies
87+
if: matrix.buni
88+
run: mise run buni
7989

8090
- name: Run ${{ matrix.name }}
8191
run: mise run ${{ matrix.task }}
82-
env:
83-
LINT: true
8492

85-
commitlint:
93+
lint-commitlint:
8694
runs-on: ubuntu-24.04
8795
timeout-minutes: 10
8896
permissions:
@@ -93,15 +101,18 @@ jobs:
93101
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
94102
with:
95103
fetch-depth: 0 # fetch all history for commitlint
96-
persist-credentials: false
97104

98105
- name: Install mise
99106
uses: jdx/mise-action@5083fe46898c414b2475087cc79da59e7da859e8 # v2.1.11
100107
with:
101-
version: 2025.1.0
102-
cache_save: ${{ github.ref_name == 'main' }}
103-
env:
104-
GITHUB_TOKEN: ${{ github.token }}
108+
experimental: true
109+
install: false
110+
111+
- name: Install mise tools
112+
# cspell:ignore reshim
113+
# reshim is required to avoid "No such file or directory" error
114+
# ref: https://github.com/jdx/mise/issues/2260
115+
run: mise install || (mise reshim && mise install)
105116

106117
- name: Install package.json dependencies
107118
run: mise run buni
@@ -131,19 +142,38 @@ jobs:
131142
# ref: https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
132143
env:
133144
PR_TITLE: ${{ github.event.pull_request.title }}
134-
run: echo "${PR_TITLE}" | bun run commitlint --verbose
145+
run: echo "$PR_TITLE" | bun run commitlint --verbose
135146

136147
- name: commitlint (last commit)
137148
if: steps.commitlint-push-initial.outcome == 'skipped' && steps.commitlint-push.outcome == 'skipped' && steps.commitlint-pr.outcome == 'skipped'
138149
run: bun run commitlint --verbose --from ${{ github.sha }}~1 --to ${{ github.sha }}
139150

140-
actions-timeline:
151+
lint-status:
141152
needs:
142153
- lint
143-
- commitlint
154+
- lint-commitlint
155+
144156
# skip if the workflow is called from another workflow
145157
if: ${{ !cancelled() && contains(github.workflow_ref, '/lint.yml') }}
146158

159+
runs-on: ubuntu-24.04
160+
timeout-minutes: 5
161+
162+
steps:
163+
- name: Check the status of the jobs
164+
run: |
165+
if [[ $(echo '${{ toJson(needs.*.result) }}' | jq 'all(. == "success")') == "false" ]]; then
166+
echo 'Some jobs are failed, cancelled, or skipped.'
167+
exit 1
168+
fi
169+
echo 'All jobs are successful.'
170+
171+
actions-timeline:
172+
needs:
173+
- lint-status
174+
175+
if: needs.lint-status.result == 'success' || needs.lint-status.result == 'failure'
176+
147177
runs-on: ubuntu-24.04
148178
timeout-minutes: 5
149179
permissions:

0 commit comments

Comments
 (0)