10
10
build :
11
11
strategy :
12
12
matrix :
13
- node-version : [20.x, 22.6]
13
+ node-version : [20.x, 22.6] # Need to use 22.6 due to Next.js build errors: https://github.com/vercel/next.js/issues/69263
14
14
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
15
15
16
16
name : Build with ${{ matrix.node-version }}
22
22
uses : actions/setup-node@v3
23
23
with :
24
24
node-version : ${{ matrix.node-version }}
25
- cache : " npm"
25
+ cache : npm
26
26
- run : npm ci
27
27
- run : npm run build
28
28
42
42
uses : actions/setup-node@v3
43
43
with :
44
44
node-version : ${{ matrix.node-version }}
45
- cache : " npm"
45
+ cache : npm
46
46
- run : npm ci
47
47
48
48
- name : Build Next.js for E2E tests
@@ -61,24 +61,55 @@ jobs:
61
61
run : npm run check-types
62
62
63
63
- name : Run unit tests
64
- run : npm run test
64
+ run : npm run test -- --coverage
65
65
66
66
- name : Upload coverage reports to Codecov
67
- uses : codecov/codecov-action@v3
67
+ uses : codecov/codecov-action@v4
68
68
env :
69
69
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
70
70
71
71
- name : Install Playwright (used for Storybook and E2E tests)
72
72
run : npx playwright install --with-deps
73
73
74
+ - name : Run storybook tests
75
+ run : npm run test-storybook:ci
76
+
74
77
- name : Run E2E tests
75
78
run : npx percy exec -- npm run test:e2e
76
79
env :
77
80
PERCY_TOKEN : ${{ secrets.PERCY_TOKEN }}
81
+ CLERK_SECRET_KEY : ${{ secrets.CLERK_SECRET_KEY }}
78
82
79
83
- uses : actions/upload-artifact@v3
80
84
if : always()
81
85
with :
82
86
name : test-results
83
87
path : test-results/
84
88
retention-days : 7
89
+
90
+ synchronize-with-crowdin :
91
+ name : GitHub PR synchronize with Crowdin
92
+ runs-on : ubuntu-latest
93
+
94
+ needs : [build, test]
95
+ if : github.event_name == 'pull_request'
96
+
97
+ steps :
98
+ - uses : actions/checkout@v4
99
+ with :
100
+ ref : ${{ github.event.pull_request.head.sha }} # Crowdin Actions needs to push commits to the PR branch, checkout HEAD commit instead of merge commit
101
+ fetch-depth : 0
102
+
103
+ - name : crowdin action
104
+ uses : crowdin/github-action@v2
105
+ with :
106
+ upload_sources : true
107
+ upload_translations : true
108
+ download_translations : true
109
+ create_pull_request : false
110
+ localization_branch_name : ${{ github.head_ref || github.ref_name }} # explanation here: https://stackoverflow.com/a/71158878
111
+ commit_message : ' chore: new Crowdin translations by GitHub Action'
112
+ env :
113
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
114
+ CROWDIN_PROJECT_ID : ${{ secrets.CROWDIN_PROJECT_ID }}
115
+ CROWDIN_PERSONAL_TOKEN : ${{ secrets.CROWDIN_PERSONAL_TOKEN }}
0 commit comments