-
Notifications
You must be signed in to change notification settings - Fork 8
192 lines (177 loc) · 6.48 KB
/
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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
name: 'GADS Tests'
on:
push:
branches:
- master
- dev
- hotfix
pull_request:
branches:
- master
- dev
- hotfix
paths-ignore:
- '*.md'
- VERSION
jobs:
unit_tests:
name: 'Unit Tests'
runs-on: 'ubuntu-22.04'
timeout-minutes: 30
steps:
- name: 'Check out the GADS repository'
uses: 'actions/checkout@v4'
- name: 'Install Non-CPAN dependencies'
run: |
sudo apt-get install cpanminus liblua5.3-dev
# Avoid "Install CPAN dependencies" needing to compile so much
sudo apt-get install libdancer2-perl libdatetime-format-sqlite-perl libtest-most-perl libdatetime-set-perl libdbix-class-schema-loader-perl
- name: 'Build cpanfile'
run: perl bin/output_cpanfile > cpanfile
- name: 'Install CPAN dependencies'
uses: 'perl-actions/install-with-cpanm@v1'
with:
cpanfile: 'cpanfile'
- name: 'Run the unit tests'
run: |
prove -lrs -j4 t
webdriver_tests:
name: 'Webdriver Tests for ${{ matrix.browser.name }}'
runs-on: '${{ matrix.browser.os }}'
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
browser:
- name: 'Chromium'
command: 'chromedriver --port=4444 &'
os: 'ubuntu-22.04'
- name: 'Firefox'
command: 'MOZ_HEADLESS=1 geckodriver --log warn &'
os: 'ubuntu-20.04'
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgrespassword
POSTGRES_DB: postgres
ports:
- 5432:5432
env:
GADS_USERNAME: '[email protected]'
GADS_PASSWORD: 'xyz123'
steps:
- name: 'Check out the GADS code'
uses: 'actions/checkout@v4'
- name: 'Install Non-CPAN dependencies'
run: |
sudo apt-get install cpanminus liblua5.3-dev
# Avoid "Install CPAN dependencies" needing to compile so much
sudo apt-get install libdatetime-format-sqlite-perl libtest-most-perl libdatetime-set-perl libdbix-class-schema-loader-perl
- name: 'Build cpanfile'
run: |
perl bin/output_cpanfile > cpanfile
( cd webdriver && perl ../bin/output_cpanfile ) >> cpanfile
- name: 'Install CPAN dependencies'
uses: 'perl-actions/install-with-cpanm@v1'
with:
cpanfile: 'cpanfile'
- name: 'Set up credentials for psql'
# See https://wiki.postgresql.org/wiki/Pgpass
run: |
echo '*:*:*:postgres:postgrespassword' > ~/.pgpass
chmod 600 ~/.pgpass
- name: 'Start the application'
env:
DANCER_CONFDIR: 'webdriver'
PGDATABASE: 'postgres'
PGHOST: 'localhost'
PGUSER: 'postgres'
run: |
./bin/setup_database
perl bin/app.pl &
- name: 'Run the Webdriver implementation'
run: '${{ matrix.browser.command }}'
- name: 'Run the Webdriver tests'
run: prove -lmrsv webdriver/t
cypress_tests:
name: 'Cypress Tests for ${{ matrix.browser.name }}'
runs-on: '${{ matrix.browser.os }}'
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
browser:
- name: 'chrome'
os: 'ubuntu-22.04'
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgrespassword
POSTGRES_DB: postgres
ports:
- 5432:5432
env:
GADS_USERNAME: '[email protected]'
GADS_PASSWORD: 'xyz123'
steps:
- name: 'Check out the GADS code'
uses: 'actions/checkout@v4'
- name: 'Install Non-CPAN dependencies'
run: |
sudo apt-get install cpanminus liblua5.3-dev gcc g++ libdatetime-format-sqlite-perl libtest-most-perl libdatetime-set-perl
sudo apt-get install libdbix-class-schema-loader-perl libmagic-dev postgresql-client libpng-dev libssl-dev libpq-dev
sudo apt-get install libjson-perl libsession-token-perl libnet-oauth2-authorizationserver-perl libtext-csv-encoded-perl
sudo apt-get install libcrypt-urandom-perl libhtml-scrubber-perl libtext-markdown-perl libwww-form-urlencoded-xs-perl
sudo apt-get install libstring-camelcase-perl libmail-transport-perl liblog-log4perl-perl libplack-perl libdbd-pg-perl
sudo apt-get install libmail-message-perl libmath-random-isaac-xs-perl libdbix-class-helpers-perl libtree-dagnode-perl
sudo apt-get install libmath-round-perl libdatetime-format-dateparse-perl libwww-mechanize-perl libdatetime-format-iso8601-perl
sudo apt-get install libmoox-types-mooselike-perl libmoox-singleton-perl libdancer2-perl liblist-compare-perl
sudo apt-get install liburl-encode-perl libtie-cache-perl libhtml-fromtext-perl libdata-compare-perl libfile-bom-perl
sudo apt-get install libalgorithm-dependency-perl libdancer-plugin-auth-extensible-perl libfile-libmagic-perl postfix
- name: 'Build cpanfile'
run: |
perl bin/output_cpanfile > cpanfile
- name: 'Install CPAN dependencies'
uses: 'perl-actions/install-with-cpanm@v1'
with:
cpanfile: 'cpanfile'
- name: 'Set up credentials for psql'
# See https://wiki.postgresql.org/wiki/Pgpass
run: |
echo '*:*:*:postgres:postgrespassword' > ~/.pgpass
chmod 600 ~/.pgpass
- name: 'Install YARN dependencies'
run: |
sudo apt-get install libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb
yarn
- name: 'Start the application'
env:
DANCER_CONFDIR: 'webdriver'
PGDATABASE: 'postgres'
PGHOST: 'localhost'
PGUSER: 'postgres'
TEST: '1'
run: |
./bin/setup_database
perl bin/app.pl &
- name: 'Run the Cypress tests'
run: yarn cypress run --browser ${{ matrix.browser.name }}
js_tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- run: yarn
- run: yarn jest --passWithNoTests