-
Notifications
You must be signed in to change notification settings - Fork 15
123 lines (108 loc) · 3.04 KB
/
ci.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
name: Build and Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
typescript-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install node dependencies
run: npm ci
- name: Run typescript
run: npx tsc -p tests/tsconfig.json --noEmit
code-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install node dependencies
run: npm ci
- name: Prettier check (tests and certain files)
run: npm run prettier-check
jest-unit-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup java for access to `ant`
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Install node dependencies
run: npm ci
- name: Test building with ant
run: |
cd resources/build && ant && cd ..
- name: Run js unit tests
run: npm run test
playwright-e2e-tests:
strategy:
matrix:
shardIndex: [1, 2, 3, 4, 5]
shardTotal: [5]
# If one of the shards fails, continue running the remaining tests
fail-fast: false
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout the code under test
uses: actions/checkout@v4
with:
submodules: true
path: 'helioviewer.org'
- name: Checkout the latest Helioviewer API
uses: actions/checkout@v4
with:
repository: 'Helioviewer-Project/api'
path: 'api'
# See https://github.com/actions/checkout?tab=readme-ov-file#fetch-only-a-single-file
- name: Checkout the Dockerfile for local Helioviewer
uses: actions/checkout@v4
with:
repository: 'Helioviewer-Project/helioviewer.org-docker'
path: 'compose'
sparse-checkout: |
compose.yaml
.env.example
sparse-checkout-cone-mode: false
- name: Print current directory
run: |
echo $(pwd)
echo $(ls)
- name: Setup environment file
run: mv compose/.env.example .env
- name: Start local Helioviewer environment
id: docker
run: |
mv compose/compose.yaml .
docker compose up -d --wait
- name: Show docker compose logs
if: always()
run: |
docker compose logs
cat compose.yaml
- name: Fix cache directory permissions
if: always()
run: |
docker compose exec web chown 33:33 cache
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install Playwright Browsers
run: |
cd helioviewer.org
npx playwright install --with-deps
- name: Run Playwright tests
run: |
cd helioviewer.org
npx playwright test --shard=${{matrix.shardIndex}}/${{matrix.shardTotal}}
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report-${{matrix.shardIndex}}
path: helioviewer.org/playwright-report/
retention-days: 7