forked from vitessio/vitess
-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (47 loc) · 1.71 KB
/
vtadmin_web_unit_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
name: vtadmin-web unit tests
# In specifying the 'paths' property, we need to include the path to this workflow .yml file.
# See https://github.community/t/trigger-a-workflow-on-change-to-the-yml-file-itself/17792/4)
on:
push:
paths:
- '.github/workflows/vtadmin_web_unit_tests.yml'
- 'web/vtadmin/**'
pull_request:
paths:
- '.github/workflows/vtadmin_web_unit_tests.yml'
- 'web/vtadmin/**'
permissions: read-all
jobs:
unit-tests:
runs-on:
group: vitess-ubuntu20
steps:
- name: Skip CI
run: |
if [[ "${{contains( github.event.pull_request.labels.*.name, 'Skip CI')}}" == "true" ]]; then
echo "skipping CI due to the 'Skip CI' label"
exit 1
fi
- name: Check if workflow needs to be skipped
id: skip-workflow
run: |
skip='false'
echo Skip ${skip}
echo "skip-workflow=${skip}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
if: steps.skip-workflow.outputs.skip-workflow == 'false'
- uses: actions/setup-node@v4
if: steps.skip-workflow.outputs.skip-workflow == 'false'
with:
# node-version should match package.json
node-version: '18.16.0'
- name: Install dependencies
if: steps.skip-workflow.outputs.skip-workflow == 'false'
run: cd ./web/vtadmin && npm ci
- name: Run unit tests
if: steps.skip-workflow.outputs.skip-workflow == 'false'
run: cd ./web/vtadmin && CI=true npm run test
# Cancel pending and in-progress runs of this workflow if a newer ref is pushed to CI.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true