@@ -2,16 +2,59 @@ name: CI
22
33on : [push, pull_request]
44
5+ env :
6+ CI : " ON" # We can detect this in the build system and other vendors implement it
7+ CMAKE_BUILD_PARALLEL_LEVEL : " 2" # 2 cores on each GHA VM, enable parallel builds
8+ CTEST_OUTPUT_ON_FAILURE : " ON" # This way we don't need a flag to ctest
9+ CTEST_PARALLEL_LEVEL : " 2"
10+ HOMEBREW_NO_ANALYTICS : " ON" # Make Homebrew installation a little quicker
11+ HOMEBREW_NO_AUTO_UPDATE : " ON"
12+ HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK : " ON"
13+ HOMEBREW_NO_GITHUB_API : " ON"
14+ HOMEBREW_NO_INSTALL_CLEANUP : " ON"
15+
516jobs :
6- Linux :
7- runs-on : ubuntu-latest
17+ Build :
18+ runs-on : ${{ matrix.os }}
19+ strategy :
20+ fail-fast : false
21+ matrix :
22+ os : [ubuntu-latest, macos-latest]
23+ gcc_v : [7, 8, 9] # Version of GFortran we want to use.
24+ env :
25+ FC : gfortran-${{ matrix.gcc_v }}
26+
827 steps :
9- - uses : actions/checkout@v1
10- - name : Install GFortran
11- run : sudo apt-get install gfortran
12- - name : cmake
13- run : cmake .
14- - name : make
15- run : make
28+ - name : Checkout code
29+ uses : actions/checkout@v1
30+
31+ - name : Set up Python 3.x
32+ uses : actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc.
33+ with :
34+ python-version : 3.x
35+
36+ - name : Set up common
37+ run : pip install --upgrade cmake
38+
39+ - name : Install GFortran Linux
40+ if : contains( matrix.os, 'ubuntu')
41+ run : |
42+ sudo add-apt-repository ppa:ubuntu-toolchain-r/test
43+ sudo apt-get update
44+ sudo apt-get install -y gcc-${GCC_V} gfortran-${GCC_V}
45+ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
46+ --slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
47+ --slave /usr/bingcov gcov /usr/bin/gcov-${GCC_V}
48+
49+ - name : Install GFortran macOS
50+ if : contains( matrix.os, 'macos')
51+ run : brew install gcc@${GCC_V} || brew upgrade gcc@${GCC_V} || true
52+
53+ - name : Configure with CMake
54+ run : cmake -Wdev -S . -B . # We should build out of source but loadtxt needs fixing
55+
56+ - name : Build and compile
57+ run : cmake --build . || cmake --build . --verbose --parallel 1
58+
1659 - name : test
17- run : ctest --output-on-failure
60+ run : cmake --build . --target test
0 commit comments