@@ -2,42 +2,86 @@ name: Unit Tests and Coverage
2
2
3
3
on :
4
4
push :
5
- branches : [ main ]
5
+ branches : [main]
6
6
pull_request :
7
- branches : [ main ]
7
+ branches : [main]
8
8
9
9
jobs :
10
10
unit-tests :
11
- runs-on : ubuntu-latest
12
- # If we are going to use a prebuilt image like this we need a webwork repository on docker hub
13
- container : drgrice1/webwork3
11
+ runs-on : ubuntu-20.04
14
12
steps :
15
- - uses : actions/checkout@v2
13
+ - name : Checkout webwork3 source code
14
+ uses : actions/checkout@v2
15
+
16
+ # Disabling these things speeds up the setup considerably, and they are not needed for the throw away machine.
17
+ - name : Disable man-db and initramfs updates
18
+ run : |
19
+ sudo sed -i 's/yes/no/g' /etc/initramfs-tools/update-initramfs.conf
20
+ sudo rm -f /var/lib/man-db/auto-update
21
+
22
+ - name : Install dependencies
23
+ run : |
24
+ sudo apt-get update
25
+ sudo apt-get install -qy --no-install-recommends --no-install-suggests \
26
+ cpanminus \
27
+ libarray-utils-perl \
28
+ libcapture-tiny-perl \
29
+ libclass-accessor-lite-perl \
30
+ libclone-perl \
31
+ libcpanel-json-xs-perl \
32
+ libcrypt-ssleay-perl \
33
+ libdata-dump-perl \
34
+ libdatetime-format-strptime-perl \
35
+ libdbd-sqlite3-perl \
36
+ libdbix-class-inflatecolumn-serializer-perl \
37
+ libdbix-class-perl \
38
+ libdbix-dbschema-perl \
39
+ libdevel-cover-perl \
40
+ libexception-class-perl \
41
+ libextutils-config-perl \
42
+ libextutils-helpers-perl \
43
+ libextutils-installpaths-perl \
44
+ libfurl-perl \
45
+ libhttp-parser-xs-perl \
46
+ libio-socket-ssl-perl \
47
+ liblist-moreutils-perl \
48
+ libmodule-build-tiny-perl \
49
+ libnet-ssleay-perl \
50
+ libsql-translator-perl \
51
+ libtest-exception-perl \
52
+ libtest-harness-perl \
53
+ libtext-csv-perl \
54
+ libtry-tiny-perl \
55
+ libyaml-libyaml-perl
56
+ cpanm --sudo --notest \
57
+ DBIx::Class::DynamicSubclass \
58
+ Mojolicious \
59
+ Mojolicious::Plugin::NotYAMLConfig \
60
+ Mojolicious::Plugin::DBIC \
61
+ Mojolicious::Plugin::Authentication \
62
+ Devel::Cover::Report::Codecov
63
+
16
64
- name : Run perl unit tests
17
65
env :
18
66
HARNESS_PERL_SWITCHES : -MDevel::Cover
19
67
run : |
20
68
perl t/db/build_db.pl
21
69
prove -r t
22
70
23
- # we probably don'te need to upload the codecov data
24
- # - uses: actions/upload-artifact@v2
25
- # with:
26
- # name: coverage-report
27
- # path: cover_db/
28
-
29
71
- name : Push coverage analysis
30
72
if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
31
73
env :
32
74
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
33
75
run : cover -report codecov
34
76
35
- # Install node (for npm) and use it to install eslint and stylelint dependencies .
36
- - name : Use Node.js
77
+ # Install node (for npm).
78
+ - name : Set up node
37
79
uses : actions/setup-node@v2
38
80
with :
39
81
node-version : ' 16'
82
+
40
83
- name : Install Dependencies
41
84
run : npm ci
85
+
42
86
- name : Run typescript (client-side) tests
43
87
run : npm run test
0 commit comments