Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 59 additions & 1 deletion .github/workflows/ci-check-warnings-gfortran.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
FC: gfortran

jobs:
test:
check_warnings:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -67,3 +67,61 @@ jobs:
- name: Build modflow and check for warnings
run: |
meson compile -C builddir

test_night_build_script:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
defaults:
run:
shell: bash

steps:
- name: Checkout repo
uses: actions/[email protected]

- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.9

- name: Setup symbolic links on Linux
if: runner.os == 'Linux'
run: |
sudo ln -fs /usr/bin/gfortran-10 /usr/local/bin/gfortran
sudo ln -fs /usr/bin/gcc-10 /usr/local/bin/gcc
sudo ln -fs /usr/bin/g++-10 /usr/local/bin/g++

- name: Setup symbolic link to gfortran on macOS
if: runner.os == 'macOS'
shell: bash
run: |
sudo ln -fs /usr/local/bin/gfortran-10 /usr/local/bin/gfortran
sudo ln -fs /usr/local/bin/gcc-10 /usr/local/bin/gcc
sudo ln -fs /usr/local/bin/g++-10 /usr/local/bin/g++

- name: Print GNU compiler versions
run: |
gfortran --version
gcc --version
g++ --version

- name: Install python packages
run: |
.github/common/install-python-std.sh

- name: Print python package versions
run: |
pip list

- name: Update flopy MODFLOW 6 classes
working-directory: autotest
run: |
python update_flopy.py

- name: Run nightly build script
working-directory: distribution
run: |
pytest -v -s build_nightly.py
30 changes: 23 additions & 7 deletions distribution/build_nightly.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import pathlib
import platform
import shutil
import sys
Expand Down Expand Up @@ -79,13 +80,28 @@ def test_create_dirs():
def test_nightly_build():
meson_build()

env = "GITHUB_ACTIONS"
os.environ[env] = "true"
if env in os.environ:
fpth = get_zipname() + ".zip"
zip_pth = os.path.join(temppth, fpth)
success = pymake.zip_all(zip_pth, dir_pths=binpth)
assert success, f"could not create '{zip_pth}'"
# test if there are any executable files to zip
binpth_files = [
os.path.join(binpth, f)
for f in os.listdir(binpth)
if os.path.isfile(os.path.join(binpth, f))
and shutil.which(os.path.join(binpth, f), mode=os.X_OK)
and pathlib.Path(os.path.join(binpth, f)).suffix
not in (".a", ".lib", ".pdb")
]
if len(binpth_files) < 1:
raise FileNotFoundError(
f"No executable files present in {os.path.abspath(binpth)}.\n"
+ f"Available files:\n [{', '.join(os.listdir(binpth))}]"
)
else:
print(f"Files to zip:\n [{', '.join(binpth_files)}]")

fpth = get_zipname() + ".zip"
print(f"Zipping files to '{fpth}'")
zip_pth = os.path.join(temppth, fpth)
success = pymake.zip_all(zip_pth, file_pths=binpth_files)
assert success, f"Could not create '{zip_pth}'"


def test_update_mf6io():
Expand Down