Skip to content

Commit 8473820

Browse files
authored
Merge pull request #266 from dpmatthews/test-config
Simplify github actions test environments
2 parents ea93cd1 + 854591c commit 8473820

File tree

4 files changed

+31
-33
lines changed

4 files changed

+31
-33
lines changed

.github/workflows/tests.yaml

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,38 @@ on: [pull_request, workflow_dispatch]
33
jobs:
44
test:
55
strategy:
6+
fail-fast: False
67
matrix:
7-
ubuntu: ['ubuntu-16.04', 'ubuntu-18.04']
8+
ubuntu: ['ubuntu-16.04', 'ubuntu-18.04', 'ubuntu-20.04']
89
name: FCM Tests ${{matrix.ubuntu}}
910
runs-on: ${{matrix.ubuntu}}
1011
steps:
11-
- name: Check Perl Version
12-
run: perl --version
13-
14-
- name: Check SVN Version
15-
run: svn --version
16-
1712
- name: Checkout code
1813
uses: actions/checkout@v2
14+
with:
15+
fetch-depth: 0
1916

20-
- name: Pre-Install
17+
- name: Install
2118
run: |
22-
echo "export PATH=${PWD}/bin:\${PATH}" >>"${HOME}/.bashrc"
19+
sudo apt update
20+
sudo apt install -y \
21+
gfortran-9 \
22+
libconfig-inifiles-perl \
23+
libxml-parser-perl \
24+
libdbi-perl \
25+
libdbd-sqlite3-perl \
26+
python-subversion libsvn-perl \
27+
s-nail
28+
[[ ${{matrix.ubuntu}} != "ubuntu-20.04" ]] && sudo pip install 'trac' || true
2329
echo "#!/bin/bash" >"${PWD}/bin/gfortran"
2430
echo 'exec gfortran-9 "$@"' >>"${PWD}/bin/gfortran"
2531
chmod +x "${PWD}/bin/gfortran"
26-
source "${HOME}/.bashrc"
2732
28-
- name: Install
29-
run: |
30-
sudo add-apt-repository -y 'ppa:ubuntu-toolchain-r/test'
31-
sudo add-apt-repository universe
32-
sudo apt update
33-
sudo apt install -y 'cpanminus'
34-
sudo apt install -y 'build-essential' 'gfortran-9'
35-
sudo apt install -y 'libconfig-inifiles-perl' 'libxml-parser-perl'
36-
sudo apt install -y 'libdbi-perl' 'libdbd-sqlite3-perl'
37-
sudo apt install -y 'subversion' 'python-subversion' 'libsvn-perl'
38-
sudo apt install -y 's-nail' # Provides mailx
39-
sudo apt install -y 'python-pip'
40-
sudo pip install 'trac'
41-
cpanm 'Config::IniFiles' 'DBI' 'DBD::SQLite' 'XML::Parser'
33+
- name: Check Perl Version
34+
run: perl --version
35+
36+
- name: Check SVN Version
37+
run: svn --version
4238

4339
- name: Run tests
4440
run: |

sbin/svnperms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/env python
1+
#!/usr/bin/env python2
22
# -*- coding: utf-8 -*-
33
#
44
#

t/fcm-make/23-build-omp.t

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
#-------------------------------------------------------------------------------
2424
tests 16
2525
cp -r $TEST_SOURCE_DIR/$TEST_KEY_BASE/* .
26-
yes 6.0 | head -n 100 >"$TEST_KEY_BASE.exe.on.out"
27-
yes 1.0 | head -n 100 >"$TEST_KEY_BASE.exe.off.out"
26+
printf '6.0\n%.0s' {1..100} >"$TEST_KEY_BASE.exe.on.out"
27+
printf '1.0\n%.0s' {1..100} >"$TEST_KEY_BASE.exe.off.out"
2828
#-------------------------------------------------------------------------------
2929
TEST_KEY=$TEST_KEY_BASE-on # fc.flag-omp on in new mode
3030
run_pass "$TEST_KEY" fcm make

t/lib/bash/test_header

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function commit_sort() {
234234
# Sort the svn status part of the message
235235
status_sort $INPUT_FILE $TMP_OUTPUT_FILE
236236
# Sort the 'Adding/Deleting', etc part of the message
237-
python -c 'import re, sys
237+
python2 -c 'import re, sys
238238
text = sys.stdin.read()
239239
sending_lines = re.findall("^\w+ing +.*$", text, re.M)
240240
prefix = text[:text.index(sending_lines[0])]
@@ -252,7 +252,7 @@ function diff_sort() {
252252
local INPUT_FILE=$1
253253
local OUTPUT_FILE=$2
254254
# Sort the diff file order.
255-
python -c 'import re, sys
255+
python2 -c 'import re, sys
256256
text = sys.stdin.read()
257257
print "\nIndex: ".join(
258258
[l.strip() for l in sorted(re.compile("^Index: ", re.M).split(text))])
@@ -264,7 +264,7 @@ print "\nIndex: ".join(
264264
function status_sort() {
265265
local INPUT_FILE=$1
266266
local OUTPUT_FILE=$2
267-
python -c 'import re, sys
267+
python2 -c 'import re, sys
268268
text = sys.stdin.read()
269269
status_lines = re.findall("^.{7} [\w./].*$", text, re.M)
270270
prefix = text[:text.index(status_lines[0])]
@@ -277,7 +277,7 @@ print prefix + "\n".join(status_lines) + suffix.rstrip()
277277
function merge_sort() {
278278
local INPUT_FILE=$1
279279
local OUTPUT_FILE=$2
280-
python -c 'import re, sys
280+
python2 -c 'import re, sys
281281
text = sys.stdin.read()
282282
status_lines = []
283283
for line in text.splitlines():
@@ -303,8 +303,8 @@ if status_lines:
303303
}
304304

305305
function check_svn_version() {
306-
if ! svn --version | head -1 | grep -q "^svn, version 1\.\(8\|9\|10\)"; then
307-
skip_all "Tests require Subversion 1.8, 1.9 or 1.10"
306+
if [[ ! $SVN_MINOR_VERSION =~ ^1\.(8|9|10)$ ]]; then
307+
skip_all "Tests require Subversion 1.8 or later"
308308
exit 0
309309
fi
310310
}
@@ -336,6 +336,8 @@ SVN_MINOR_VERSION=undef
336336
if svn --version 1>/dev/null 2>&1; then
337337
SVN_MINOR_VERSION=$(svn --version | \
338338
sed -n "s/^svn, version 1.\([0-9]\+\)\.[0-9]\+ .*/1.\1/p")
339+
# Treat versions 1.10 and above the same for the moment
340+
[[ $SVN_MINOR_VERSION =~ ^1\.1[0-9]$ ]] && SVN_MINOR_VERSION=1.10
339341
fi
340342

341343
TEST_KEY_BASE=$(basename $0 .t)

0 commit comments

Comments
 (0)