Skip to content

Commit ed65ddf

Browse files
committed
Adapt the unit test action to not use a docker image.
1 parent 96d631f commit ed65ddf

19 files changed

+128
-71
lines changed

.github/workflows/unit-tests.yml

Lines changed: 57 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,85 @@ name: Unit Tests and Coverage
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [main]
66
pull_request:
7-
branches: [ main ]
7+
branches: [main]
88

99
jobs:
1010
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
1412
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+
1663
- name: Run perl unit tests
1764
env:
1865
HARNESS_PERL_SWITCHES: -MDevel::Cover
1966
run: |
2067
perl t/db/build_db.pl
2168
prove -r t
2269
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-
2970
- name: Push coverage analysis
3071
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
3172
env:
3273
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3374
run: cover -report codecov
3475

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
3778
uses: actions/setup-node@v2
3879
with:
3980
node-version: '16'
81+
4082
- name: Install Dependencies
4183
run: npm ci
84+
4285
- name: Run typescript (client-side) tests
4386
run: npm run test

docker/webwork3.dockerfile

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,49 @@
11
FROM ubuntu:20.04
22

3-
# the following are needed to make sure the timezone packages don't ask for your timezone.
3+
# The following are needed to make sure the timezone packages don't ask for your timezone.
44
ENV DEBIAN_FRONTEND noninteractive
55
ENV DEBCONF_NONINTERACTIVE_SEEN true
66
ENV HARNESS_PERL_SWITCHES -MDevel::Cover
77

88
RUN apt-get update && \
99
apt-get install -qy --no-install-recommends --no-install-suggests \
1010
build-essential=12.8ubuntu1 \
11-
ca-certificates=20210119~20.04.1 \
11+
ca-certificates=20211016~20.04.1 \
1212
cpanminus=1.7044-1 \
13-
git=1:2.25.1-1ubuntu3.1 \
13+
git=1:2.25.1-1ubuntu3.5 \
1414
libarray-utils-perl=0.5-1 \
15+
libcapture-tiny-perl=0.48-1 \
16+
libclass-accessor-lite-perl=0.08-1 \
1517
libclone-perl=0.43-2 \
1618
libcrypt-ssleay-perl=0.73.06-1build3 \
1719
libdata-dump-perl=1.23-1 \
1820
libdatetime-format-strptime-perl=1.7600-1 \
19-
libdbd-mysql-perl=4.050-3 \
21+
# libdbd-mysql-perl=4.050-3 \
2022
libdbd-sqlite3-perl=1.64-1build1 \
21-
libdbix-class-perl=0.082841-1 \
2223
libdbix-class-inflatecolumn-serializer-perl=0.09-1 \
24+
libdbix-class-perl=0.082841-1 \
2325
libdbix-dbschema-perl=0.45-1 \
2426
libdevel-cover-perl=1.33-1build1 \
2527
libexception-class-perl=1.44-1 \
2628
libjson-perl=4.02000-2 \
29+
libjson-xs-perl=4.020-1build1 \
30+
libextutils-config-perl=0.008-2 \
31+
libextutils-helpers-perl=0.026-1 \
32+
libextutils-installpaths-perl=0.012-1 \
33+
libfurl-perl=3.13-2 \
34+
libhttp-parser-xs-perl=0.17-1build5 \
35+
libio-socket-ssl-perl=2.067-1 \
36+
libmodule-build-tiny-perl=0.039-1 \
2737
libnet-ssleay-perl=1.88-2ubuntu1 \
2838
libsql-translator-perl=1.60-1 \
29-
libssl-dev=1.1.1f-1ubuntu2.5 \
39+
libssl-dev=1.1.1f-1ubuntu2.16 \
3040
libtest-exception-perl=0.43-1 \
3141
libtest-harness-perl=3.42-2 \
3242
libtext-csv-perl=2.00-1 \
3343
libtry-tiny-perl=0.30-1 \
3444
libyaml-libyaml-perl=0.81+repack-1 \
3545
# mariadb-server=1:10.3.31-0ubuntu0.20.04.1 \ # if desired to use a full database
36-
openssl=1.1.1f-1ubuntu2.5 && \
46+
openssl=1.1.1f-1ubuntu2.16 && \
3747
rm -rf /var/lib/apt/lists/* && \
3848
cpanm --notest \
3949
DBIx::Class::DynamicSubclass \

lib/DB/Schema/Result/Attempt.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Note: a problem should have only one of a library_id, problem_path or problem_po
5959

6060
__PACKAGE__->table('attempt');
6161

62-
__PACKAGE__->load_components('InflateColumn::Serializer', 'Core');
62+
__PACKAGE__->load_components(qw/InflateColumn::Serializer Core/);
6363

6464
__PACKAGE__->add_columns(
6565
attempt_id => {

lib/DB/Schema/Result/CourseSettings.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ C<email>: a JSON object that stores email settings
4949

5050
__PACKAGE__->table('course_settings');
5151

52-
__PACKAGE__->load_components('InflateColumn::Serializer', 'Core');
52+
__PACKAGE__->load_components(qw/InflateColumn::Serializer Core/);
5353

5454
__PACKAGE__->add_columns(
5555
course_settings_id => {

lib/DB/Schema/Result/CourseUser.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ C<showOldAnswers>: whether or not the user shows old answer (boolean)
8888

8989
__PACKAGE__->table('course_user');
9090

91-
__PACKAGE__->load_components('InflateColumn::Serializer', 'Core');
91+
__PACKAGE__->load_components(qw/InflateColumn::Serializer Core/);
9292

9393
__PACKAGE__->add_columns(
9494
course_user_id => {

lib/DB/Schema/Result/PoolProblem.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Note: the C<params> can only have one of the two fields
4848

4949
__PACKAGE__->table('pool_problem');
5050

51-
__PACKAGE__->load_components('InflateColumn::Serializer', 'Core');
51+
__PACKAGE__->load_components(qw/InflateColumn::Serializer Core/);
5252

5353
__PACKAGE__->add_columns(
5454
pool_problem_id => {

lib/DB/Schema/Result/ProblemSet.pm

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,9 @@ L<DB::Schema::Result::ProblemSet::ReviewSet> which gives properties common to re
7171
7272
=cut
7373

74-
__PACKAGE__->load_components(qw/DynamicSubclass Core/);
75-
7674
__PACKAGE__->table('problem_set');
7775

78-
__PACKAGE__->load_components(qw/DynamicSubclass Core/, qw/InflateColumn::Serializer Core/);
76+
__PACKAGE__->load_components(qw/DynamicSubclass Core InflateColumn::Serializer InflateColumn::Boolean Core/);
7977

8078
__PACKAGE__->add_columns(
8179
set_id => {

lib/DB/Schema/Result/SetProblem.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Note: a problem should have only one of a library_id, problem_path or problem_po
6565

6666
__PACKAGE__->table('set_problem');
6767

68-
__PACKAGE__->load_components('InflateColumn::Serializer', 'Core');
68+
__PACKAGE__->load_components(qw/InflateColumn::Serializer Core/);
6969

7070
__PACKAGE__->add_columns(
7171
set_problem_id => {

lib/DB/Schema/Result/UserProblem.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use base qw/DBIx::Class::Core DB::Validation/;
1515

1616
__PACKAGE__->table('user_problem');
1717

18-
__PACKAGE__->load_components('InflateColumn::Serializer', 'Core');
18+
__PACKAGE__->load_components(qw/InflateColumn::Serializer Core/);
1919

2020
__PACKAGE__->add_columns(
2121
user_problem_id => {

lib/DB/Schema/Result/UserSet.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ types have different params fields.
5858

5959
__PACKAGE__->table('user_set');
6060

61-
__PACKAGE__->load_components('InflateColumn::Serializer', 'Core');
61+
__PACKAGE__->load_components(qw/InflateColumn::Serializer InflateColumn::Boolean Core/);
6262

6363
__PACKAGE__->add_columns(
6464
user_set_id => {

0 commit comments

Comments
 (0)