Skip to content

Commit 208d991

Browse files
committed
feat: add test in release & prerelease
1 parent fa2faa2 commit 208d991

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

.github/workflows/prerelease.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ on:
66
- opened
77
- labeled
88
- synchronize
9-
branches-ignore:
10-
- docs/update-translations
11-
- docs/sync-nextjs-documentation
129

1310
permissions:
1411
pull-requests: write
@@ -67,6 +64,14 @@ jobs:
6764
echo "No enabled locales found in locales-config.json"
6865
exit 1
6966
fi
67+
test:
68+
needs: generate-matrix
69+
if: needs.generate-matrix.outputs.matrix != '[]'
70+
uses: ./.github/workflows/test-e2e.yml
71+
with:
72+
matrix-include: ${{ needs.generate-matrix.outputs.matrix }}
73+
shard-total: 5
74+
secrets: inherit
7075

7176
deploy:
7277
needs: generate-matrix

.github/workflows/release.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,18 @@ jobs:
3535
trigger-type: ${{ github.event_name == 'workflow_dispatch' && 'manual' || 'auto' }}
3636
manual-locales: ${{ github.event.inputs.locales }}
3737

38-
deploy-and-update-index:
38+
test:
3939
needs: check-changes
4040
if: needs.check-changes.outputs.matrix-include != '[]'
41+
uses: ./.github/workflows/test-e2e.yml
42+
with:
43+
matrix-include: ${{ needs.check-changes.outputs.matrix-include }}
44+
shard-total: 3
45+
secrets: inherit
46+
47+
deploy-and-update-index:
48+
needs: [check-changes, test]
49+
if: needs.check-changes.outputs.matrix-include != '[]'
4150
runs-on: ubuntu-latest
4251
strategy:
4352
matrix:
@@ -56,10 +65,6 @@ jobs:
5665
vercel_project_id: ${{ secrets[matrix.secret_project_id] }}
5766
vercel_org_id: ${{ secrets.VERCEL_ORG_ID }}
5867
vercel_token: ${{ secrets.VERCEL_TOKEN }}
59-
- name: Test
60-
run: |
61-
echo "Running tests for ${{ matrix.locale }}"
62-
pnpm --filter @next-i18n/docs test:e2e
6368
- uses: ./.github/actions/vercel-build
6469
with:
6570
environment: production

.github/workflows/test-e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
matrix:
3333
include: ${{ fromJson(inputs.matrix-include) }}
3434
shard: ${{ fromJson(needs.prepare-shards.outputs.shard-array) }}
35-
name: Test ${{ matrix.locale }} (Shard ${{ matrix.shard }})
35+
name: Test ${{ matrix.locale }} (Shard ${{ matrix.shard }}/${{ inputs.shard-total }})
3636
steps:
3737
- name: Checkout code
3838
uses: actions/checkout@v3

0 commit comments

Comments
 (0)