-
Notifications
You must be signed in to change notification settings - Fork 10
68 lines (66 loc) · 2.29 KB
/
e2e-shard-tests.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Run sharded e2e tests
on:
workflow_call:
inputs:
project:
required: true
type: string
shardIndex:
required: true
type: number
shardTotal:
required: true
type: number
secrets:
NPM_TOKEN:
required: true
jobs:
test-e2e:
runs-on: ubuntu-latest
steps:
- name: Checkout all commits
uses: actions/checkout@v3
with:
fetch-depth: 0
# Full setup required since building the JS SDK requires Go.
- name: Setup environment
uses: ./.github/actions/setup-all
with:
node_version: 20.10.0
go_version: 1.23.0
- name: Only run if ${{ inputs.project }} is affected
id: check
run: |
AFFECTED=$(npx nx show projects --affected --projects=${{ inputs.project }})
if [[ -z "$AFFECTED" ]]; then
echo "${{ inputs.project }} is unaffected. Exiting."
echo "continue=false" >> $GITHUB_OUTPUT
else
echo "${{ inputs.project }} is affected. Continuing."
echo "continue=true" >> $GITHUB_OUTPUT
fi
# The SDK is referenced via dist in the tsconfig.base.json because the
# next executor does not actually support buildLibsFromSource=false.
# With this configuration NX does not build the SDK as expected when
# it is an app dependency.
- name: Force build SDK
if: ${{ steps.check.outputs.continue == 'true' }}
shell: bash
run: npx nx run sdk:build
- name: Install Playwright dependencies
if: ${{ steps.check.outputs.continue == 'true' }}
shell: bash
run: npx playwright install-deps
- name: Test e2e for ${{ inputs.project }}
if: ${{ steps.check.outputs.continue == 'true' }}
shell: bash
run: npx nx run ${{ inputs.project }}:e2e --shard=${{ inputs.shardIndex }}/${{ inputs.shardTotal }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Upload blob report to GitHub Actions Artifacts
if: ${{ steps.check.outputs.continue == 'true' && !cancelled() }}
uses: actions/upload-artifact@v4
with:
name: ${{ inputs.project }}-blob-report-${{ inputs.shardIndex }}
path: blob-report
retention-days: 1