-
Notifications
You must be signed in to change notification settings - Fork 51
75 lines (65 loc) · 2.06 KB
/
FissionUnitTest.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
69
70
71
72
73
74
75
name: Fission - Unit Test
on:
workflow_dispatch: {}
push:
branches: [ prod, dev ]
pull_request:
branches: [ prod, dev ]
jobs:
runUnitTests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: JavaScript Setup
uses: actions/setup-node@v2
with:
node-version: 20
- name: Cache downloaded assets
id: cache-assets
uses: actions/cache@v2
with:
path: fission/public/
key: ${{ runner.os }}-assets-v1
restore-keys: |
${{ runner.os }}-assets-
- name: Download assets if not cached
if: steps.cache-assets.outputs.cache-hit != 'true'
run: |
cd fission
curl -o public/assetpack.zip https://synthesis.autodesk.com/Downloadables/assetpack.zip && unzip -o public/assetpack.zip -d public/
- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV
- name: Cache downloaded browsers
id: cache-browsers
uses: actions/cache@v2
with:
path: |
~/.cache/ms-playwright/
key: ${{ runner.os }}-assets-playwright-${{ env.PLAYWRIGHT_VERSION }}-v2
- name: Install Dependencies
run: |
cd fission
npm install
- name: Download playwright if not cached
if: steps.cache-browsers.outputs.cache-hit != 'true'
run: |
cd fission
npx playwright install --with-deps
npx playwright install-deps
- name: Unit Tests
id: unit-tests
run: |
cd fission
npm run test
continue-on-error: true
- name: Check Success
run: |
if [ ${{ steps.unit-tests.outcome }} == "success" ]; then
echo "Format Validation Passed"
else
echo "Format Validation Failed"
exit 1
fi