Skip to content

Commit 263183b

Browse files
authored
CI: Cleanup and enable Fortran tests (#269)
1 parent a3d536f commit 263183b

File tree

2 files changed

+53
-48
lines changed

2 files changed

+53
-48
lines changed

.github/workflows/CI.yml

+7-48
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,21 @@ jobs:
2828

2929
steps:
3030
- uses: actions/checkout@v1
31-
- name: Set defaults
32-
run: |
33-
export GCC_VERSION=$(echo ${{ matrix.compiler }} | cut -d'-' -f2)
34-
echo "FC=gfortran-${GCC_VERSION}" >> $GITHUB_ENV
35-
echo "TEST_FORTRAN=OFF" >> $GITHUB_ENV # default will be overwritten in the next step
3631
- name: Enable Fortran
37-
if: startsWith(matrix.compiler, 'clang') == 'false'
32+
if: startsWith(matrix.compiler, 'gcc')
3833
run: echo "TEST_FORTRAN=ON" >> $GITHUB_ENV
3934
- name: Install python modules
4035
run: pip3 install --user nose-py3 numpy
4136
- name: Cache pFUnit
4237
id: cache-pfunit
43-
uses: actions/cache@v1
38+
uses: actions/cache@v3.2.4
4439
with:
4540
path: pfunit
4641
key: ${{ matrix.compiler }}-pfunit
4742
- name: Install pFUnit
4843
if: startsWith(matrix.compiler, 'gcc') && steps.cache-pfunit.outputs.cache-hit != 'true'
4944
env:
50-
PFUNIT_VERSION: 4.4.1
45+
PFUNIT_VERSION: 4.6.3
5146
run: |
5247
apt-get update && apt-get -y install m4
5348
git clone --branch v${PFUNIT_VERSION} --depth 1 https://github.com/Goddard-Fortran-Ecosystem/pFUnit.git
@@ -59,8 +54,8 @@ jobs:
5954
id: ccache_cache_timestamp
6055
shell: cmake -P {0}
6156
run: |
62-
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
63-
message("::set-output name=timestamp::${current_date}")
57+
string(TIMESTAMP current_date "%Y-%m-%d-%H-%M-%S" UTC)
58+
message("echo \"timestamp=${current_date}\" >> $GITHUB_OUTPUT")
6459
- name: Set ccache environment
6560
run: |
6661
echo "CCACHE_MAXSIZE=400M" >> $GITHUB_ENV
@@ -69,10 +64,10 @@ jobs:
6964
echo "CCACHE_COMPRESS=true" >> $GITHUB_ENV
7065
echo "CCACHE_COMPRESSLEVEL=6" >> $GITHUB_ENV
7166
- name: ccache cache files
72-
uses: actions/cache@v1
67+
uses: actions/cache@v3.2.4
7368
with:
7469
path: .ccache
75-
key: ${{ matrix.compiler }}-${{ matrix.build_type }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
70+
key: ${{ matrix.compiler }}-${{ matrix.build_type }}-ccache-${{ steps.ccache_cache_timestamp.outputs.timestamp }}
7671
restore-keys: |
7772
${{ matrix.compiler }}-${{ matrix.build_type }}-ccache-
7873
- name: Configure
@@ -93,39 +88,3 @@ jobs:
9388
run: cmake --build build --parallel 2
9489
- name: Execute tests
9590
run: cd build && ctest --output-on-failure
96-
97-
build-python:
98-
strategy:
99-
matrix:
100-
os: [ubuntu-latest, macos-latest]
101-
python-version: ["3.10"]
102-
runs-on: ${{ matrix.os }}
103-
steps:
104-
- uses: actions/checkout@v3
105-
- name: install boost on macos
106-
if: ${{ matrix.os == 'macos-latest'}}
107-
run: |
108-
brew install boost
109-
- name: install boost for ubuntu
110-
if: ${{ matrix.os == 'ubuntu-latest'}}
111-
run: |
112-
sudo apt-get update
113-
sudo apt-get install libboost-all-dev
114-
115-
- name: Set up Python ${{ matrix.python-version }}
116-
uses: actions/setup-python@v4
117-
with:
118-
python-version: ${{ matrix.python-version }}
119-
cache: "pip"
120-
121-
- name: upgrade python tools
122-
run: python -m pip install --upgrade pip setuptools wheel
123-
124-
- name: install dependencies
125-
run: pip install -r src/serialbox-python/requirements.txt
126-
127-
- name: build
128-
run: pip install src/serialbox-python
129-
130-
- name: run tests
131-
run: pytest -v test/serialbox-python/serialbox >> $GITHUB_STEP_SUMMARY

.github/workflows/pip_package.yml

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: pip package
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
11+
jobs:
12+
build-python:
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest, macos-latest]
16+
python-version: ["3.10"]
17+
runs-on: ${{ matrix.os }}
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: install boost on macos
21+
if: ${{ matrix.os == 'macos-latest'}}
22+
run: |
23+
brew install boost
24+
- name: install boost for ubuntu
25+
if: ${{ matrix.os == 'ubuntu-latest'}}
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install libboost-all-dev
29+
30+
- name: Set up Python ${{ matrix.python-version }}
31+
uses: actions/setup-python@v4
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
cache: "pip"
35+
36+
- name: upgrade python tools
37+
run: python -m pip install --upgrade pip setuptools wheel
38+
39+
- name: install dependencies
40+
run: pip install -r src/serialbox-python/requirements.txt
41+
42+
- name: build
43+
run: pip install src/serialbox-python
44+
45+
- name: run tests
46+
run: pytest -v test/serialbox-python/serialbox >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)