Skip to content

Commit 84a22e7

Browse files
committed
Adapt the unit test action to not use a docker image.
This uses Ubuntu 22.04 for the runner and docker image.
1 parent 4bad6ca commit 84a22e7

20 files changed

+165
-95
lines changed

.github/workflows/linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
# Run Linter against code base #
5757
################################
5858
- name: Super-Linter
59-
uses: github/super-linter@v4.8.1
59+
uses: github/super-linter@v4.9.5
6060

6161
env:
6262
VALIDATE_ALL_CODEBASE: false

.github/workflows/unit-tests.yml

Lines changed: 66 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,94 @@
1+
---
12
name: Unit Tests and Coverage
23

34
on:
45
push:
5-
branches: [ main ]
6+
branches: [main]
67
pull_request:
7-
branches: [ main ]
8+
branches: [main]
89

910
jobs:
1011
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
12+
runs-on: ubuntu-22.04
1413
steps:
15-
- uses: actions/checkout@v2
14+
- name: Checkout webwork3 source code
15+
uses: actions/checkout@v3
16+
17+
# Disabling these things speeds up the setup considerably, and they are not needed for the throw away machine.
18+
- name: Disable man-db and initramfs updates
19+
run: |
20+
sudo sed -i 's/yes/no/g' /etc/initramfs-tools/update-initramfs.conf
21+
sudo rm -f /var/lib/man-db/auto-update
22+
23+
- name: Install dependencies
24+
env:
25+
DEBIAN_FRONTEND: noninteractive
26+
DEBCONF_NONINTERACTIVE_SEEN: true
27+
DEBCONF_NOWARNINGS: yes
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -qy --no-install-recommends --no-install-suggests \
31+
cpanminus \
32+
libarray-utils-perl \
33+
libcanary-stability-perl \
34+
libcapture-tiny-perl \
35+
libclass-accessor-lite-perl \
36+
libclone-perl \
37+
libcpanel-json-xs-perl \
38+
libcrypt-ssleay-perl \
39+
libdata-dump-perl \
40+
libdatetime-format-strptime-perl \
41+
libdbd-sqlite3-perl \
42+
libdbix-class-inflatecolumn-serializer-perl \
43+
libdbix-class-perl \
44+
libdbix-dbschema-perl \
45+
libdevel-cover-perl \
46+
libexception-class-perl \
47+
libextutils-config-perl \
48+
libextutils-helpers-perl \
49+
libextutils-installpaths-perl \
50+
libfurl-perl \
51+
libhttp-parser-xs-perl \
52+
libimporter-perl \
53+
libio-socket-ssl-perl \
54+
liblist-moreutils-perl \
55+
libmodule-build-tiny-perl \
56+
libmojolicious-perl \
57+
libmojolicious-plugin-authentication-perl \
58+
libnet-ssleay-perl \
59+
libsql-translator-perl \
60+
libtest-exception-perl \
61+
libtest-harness-perl \
62+
libtext-csv-perl \
63+
libtry-tiny-perl \
64+
libyaml-libyaml-perl
65+
cpanm --sudo --notest \
66+
DBIx::Class::DynamicSubclass \
67+
Mojolicious::Plugin::DBIC \
68+
Mojolicious::Plugin::NotYAMLConfig \
69+
Devel::Cover::Report::Codecov
70+
1671
- name: Run perl unit tests
1772
env:
1873
HARNESS_PERL_SWITCHES: -MDevel::Cover
1974
run: |
2075
perl t/db/build_db.pl
2176
prove -r t
2277
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-
2978
- name: Push coverage analysis
3079
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
3180
env:
3281
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3382
run: cover -report codecov
3483

35-
# Install node (for npm) and use it to install eslint and stylelint dependencies.
36-
- name: Use Node.js
37-
uses: actions/setup-node@v2
84+
# Install node (for npm).
85+
- name: Set up node
86+
uses: actions/setup-node@v3
3887
with:
3988
node-version: '16'
89+
4090
- name: Install Dependencies
4191
run: npm ci
92+
4293
- name: Run typescript (client-side) tests
4394
run: npm run test

docker/webwork3.dockerfile

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,61 @@
1-
FROM ubuntu:20.04
1+
FROM ubuntu:22.04
22

3-
# the following are needed to make sure the timezone packages don't ask for your timezone.
43
ENV DEBIAN_FRONTEND noninteractive
54
ENV DEBCONF_NONINTERACTIVE_SEEN true
5+
ENV DEBCONF_NOWARNINGS yes
66
ENV HARNESS_PERL_SWITCHES -MDevel::Cover
77

88
RUN apt-get update && \
99
apt-get install -qy --no-install-recommends --no-install-suggests \
10-
build-essential=12.8ubuntu1 \
11-
ca-certificates=20210119~20.04.1 \
12-
cpanminus=1.7044-1 \
13-
git=1:2.25.1-1ubuntu3.1 \
14-
libarray-utils-perl=0.5-1 \
15-
libclone-perl=0.43-2 \
16-
libcrypt-ssleay-perl=0.73.06-1build3 \
17-
libdata-dump-perl=1.23-1 \
18-
libdatetime-format-strptime-perl=1.7600-1 \
19-
libdbd-mysql-perl=4.050-3 \
20-
libdbd-sqlite3-perl=1.64-1build1 \
21-
libdbix-class-perl=0.082841-1 \
10+
ca-certificates=20211016 \
11+
cpanminus=1.7045-1 \
12+
git=1:2.34.1-1ubuntu1.4 \
13+
libarray-utils-perl=0.5-2 \
14+
libcanary-stability-perl=2006-2 \
15+
libcapture-tiny-perl=0.48-1 \
16+
libclass-accessor-lite-perl=0.08-1.1 \
17+
libclone-perl=0.45-1build3 \
18+
libcommon-sense-perl=3.75-2build1 \
19+
libcpanel-json-xs-perl=4.27-1build1 \
20+
libcrypt-ssleay-perl=0.73.06-1build6 \
21+
libdata-dump-perl=1.25-1 \
22+
libdatetime-format-strptime-perl=1.7900-1 \
23+
#libdbd-mysql-perl=4.050-5 \ # if desired to use a full database
24+
libdbd-sqlite3-perl=1.70-3build1 \
2225
libdbix-class-inflatecolumn-serializer-perl=0.09-1 \
26+
libdbix-class-perl=0.082842-3 \
2327
libdbix-dbschema-perl=0.45-1 \
24-
libdevel-cover-perl=1.33-1build1 \
25-
libexception-class-perl=1.44-1 \
26-
libjson-perl=4.02000-2 \
27-
libnet-ssleay-perl=1.88-2ubuntu1 \
28-
libsql-translator-perl=1.60-1 \
29-
libssl-dev=1.1.1f-1ubuntu2.5 \
28+
libdevel-cover-perl=1.36-2build2 \
29+
libc6-dev=2.35-0ubuntu3.1 \
30+
libexception-class-perl=1.45-1 \
31+
libextutils-config-perl=0.008-2 \
32+
libextutils-helpers-perl=0.026-1 \
33+
libextutils-installpaths-perl=0.012-1.1 \
34+
libfurl-perl=3.14-2 \
35+
libhttp-parser-xs-perl=0.17-2build1 \
36+
libimporter-perl=0.026-1 \
37+
libio-socket-ssl-perl=2.074-2 \
38+
libjson-perl=4.04000-1 \
39+
libjson-xs-perl=4.030-1build3 \
40+
libmodule-build-tiny-perl=0.039-1.1 \
41+
libmojolicious-perl=9.22+dfsg-1 \
42+
libmojolicious-plugin-authentication-perl=1.37-1 \
43+
libnet-ssleay-perl=1.92-1build2 \
44+
libsql-translator-perl=1.62-1 \
45+
libssl-dev=3.0.2-0ubuntu1.6 \
3046
libtest-exception-perl=0.43-1 \
31-
libtest-harness-perl=3.42-2 \
32-
libtext-csv-perl=2.00-1 \
33-
libtry-tiny-perl=0.30-1 \
34-
libyaml-libyaml-perl=0.81+repack-1 \
35-
# mariadb-server=1:10.3.31-0ubuntu0.20.04.1 \ # if desired to use a full database
36-
openssl=1.1.1f-1ubuntu2.5 && \
47+
libtext-csv-perl=2.01-1 \
48+
libtry-tiny-perl=0.31-1 \
49+
libtypes-serialiser-perl=1.01-1 \
50+
libyaml-libyaml-perl=0.83+ds-1build1 \
51+
make=4.3-4.1build1 \
52+
#mariadb-server=1:10.6.7-2ubuntu1.1 \ # if desired to use a full database
53+
openssl=3.0.2-0ubuntu1.6 && \
3754
rm -rf /var/lib/apt/lists/* && \
3855
cpanm --notest \
3956
DBIx::Class::DynamicSubclass \
40-
Mojolicious \
41-
Mojolicious::Plugin::NotYAMLConfig \
4257
Mojolicious::Plugin::DBIC \
43-
Mojolicious::Plugin::Authentication \
58+
Mojolicious::Plugin::NotYAMLConfig \
4459
Devel::Cover::Report::Codecov
4560

4661
ENTRYPOINT ["/bin/bash"]

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 => {

0 commit comments

Comments
 (0)