@@ -2,42 +2,85 @@ 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
+ libcrypt-ssleay-perl \
32
+ libdata-dump-perl \
33
+ libdatetime-format-strptime-perl \
34
+ libdbd-sqlite3-perl \
35
+ libdbix-class-inflatecolumn-serializer-perl \
36
+ libdbix-class-perl \
37
+ libdbix-dbschema-perl \
38
+ libdevel-cover-perl \
39
+ libexception-class-perl \
40
+ libextutils-config-perl \
41
+ libextutils-helpers-perl \
42
+ libextutils-installpaths-perl \
43
+ libfurl-perl \
44
+ libhttp-parser-xs-perl \
45
+ libio-socket-ssl-perl \
46
+ liblist-moreutils-perl \
47
+ libmodule-build-tiny-perl \
48
+ libnet-ssleay-perl \
49
+ libsql-translator-perl \
50
+ libtest-exception-perl \
51
+ libtest-harness-perl \
52
+ libtext-csv-perl \
53
+ libtry-tiny-perl \
54
+ libyaml-libyaml-perl
55
+ cpanm --sudo --notest \
56
+ DBIx::Class::DynamicSubclass \
57
+ Mojolicious \
58
+ Mojolicious::Plugin::NotYAMLConfig \
59
+ Mojolicious::Plugin::DBIC \
60
+ Mojolicious::Plugin::Authentication \
61
+ Devel::Cover::Report::Codecov
62
+
16
63
- name : Run perl unit tests
17
64
env :
18
65
HARNESS_PERL_SWITCHES : -MDevel::Cover
19
66
run : |
20
67
perl t/db/build_db.pl
21
68
prove -r t
22
69
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
70
- name : Push coverage analysis
30
71
if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
31
72
env :
32
73
CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
33
74
run : cover -report codecov
34
75
35
- # Install node (for npm) and use it to install eslint and stylelint dependencies .
36
- - name : Use Node.js
76
+ # Install node (for npm).
77
+ - name : Set up node
37
78
uses : actions/setup-node@v2
38
79
with :
39
80
node-version : ' 16'
81
+
40
82
- name : Install Dependencies
41
83
run : npm ci
84
+
42
85
- name : Run typescript (client-side) tests
43
86
run : npm run test
0 commit comments