-
Notifications
You must be signed in to change notification settings - Fork 10
105 lines (95 loc) · 3.21 KB
/
unit-tests.yml
File metadata and controls
105 lines (95 loc) · 3.21 KB
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
---
name: Unit Tests and Coverage
on:
push:
pull_request:
branches: [main]
jobs:
unit-tests:
runs-on: ubuntu-22.04
steps:
- name: Checkout webwork3 source code
uses: actions/checkout@v3
# Disabling these things speeds up the setup considerably, and they are not needed for the throw away machine.
- name: Disable man-db and initramfs updates
run: |
sudo sed -i 's/yes/no/g' /etc/initramfs-tools/update-initramfs.conf
sudo rm -f /var/lib/man-db/auto-update
- name: Install dependencies
env:
DEBIAN_FRONTEND: noninteractive
DEBCONF_NONINTERACTIVE_SEEN: true
DEBCONF_NOWARNINGS: yes
run: |
sudo apt-get update
sudo apt-get install -qy --no-install-recommends --no-install-suggests \
cpanminus \
libarray-utils-perl \
libcanary-stability-perl \
libcapture-tiny-perl \
libclass-accessor-lite-perl \
libclone-perl \
libcpanel-json-xs-perl \
libcrypt-ssleay-perl \
libdata-dump-perl \
libdatetime-format-strptime-perl \
libdbd-sqlite3-perl \
libdbd-mysql-perl \
libdbix-class-inflatecolumn-serializer-perl \
libdbix-class-perl \
libdbix-dbschema-perl \
libdevel-cover-perl \
libexception-class-perl \
libextutils-config-perl \
libextutils-helpers-perl \
libextutils-installpaths-perl \
libfurl-perl \
libhttp-parser-xs-perl \
libimporter-perl \
libio-socket-ssl-perl \
liblist-moreutils-perl \
libmodule-build-tiny-perl \
libmojolicious-perl \
libmojolicious-plugin-authentication-perl \
libnet-ssleay-perl \
libsql-translator-perl \
libsub-info-perl \
libterm-table-perl \
libtest-harness-perl \
libtest2-suite-perl \
libtest-postgresql-perl \
libtext-csv-perl \
libtry-tiny-perl \
libyaml-libyaml-perl \
mariadb-client \
mariadb-server \
postgresql
cpanm --sudo --notest \
DBIx::Class::DynamicSubclass \
Mojolicious::Plugin::DBIC \
Mojolicious::Plugin::NotYAMLConfig \
Test2::MojoX \
Devel::Cover::Report::Codecov
- name: Run perl unit tests
env:
HARNESS_PERL_SWITCHES: -MDevel::Cover
WW3_TEST_ALL_DBS: 1
run: prove -r t
- name: Push coverage analysis
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: cover -report codecov
# Install node (for npm).
- name: Set up node
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install Dependencies
run: npm ci
- name: Run jest client-side tests
run: npm run test
- name: Run jest pinia stores tests.
env:
WW3_TEST_ALL_DBS: 1
run: bin/dev_scripts/test_pinia_stores.pl