Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: update workflow file to use modflowpy/install-intelfortran-action #15

Merged
merged 6 commits into from
Dec 10, 2022
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
45 changes: 26 additions & 19 deletions .github/common/build_executables.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import os
import sys
import pymake
import subprocess
import pathlib as pl

RETRIES = 3


def get_ostag() -> str:
Expand All @@ -27,30 +26,38 @@ def get_cctag() -> str:
raise ValueError(f"platform {sys.platform!r} not supported")


def mfpymake_run_command(args) -> bool:
success = False
for idx in range(RETRIES):
p = subprocess.run(args)
if p.returncode == 0:
success = True
break
print(f"{args[0]} run {idx + 1}/{RETRIES} failed...rerunning")
return success


if __name__ == "__main__":
path = (pl.Path(os.path.dirname(pymake.__file__)) / "../").resolve()
print(f"path to pymake: {path}")
cmd = [
"make-code-json",
"-f",
f"{get_ostag()}/code.json",
"--verbose",
]

file_path = pl.Path(".github/common/buildall.py")
if not mfpymake_run_command(cmd):
raise RuntimeError(f"could not run {cmd[0]}")

cmds = [
"python",
file_path,
cmd = [
"make-program",
":",
f"--appdir={get_ostag()}",
"-fc=ifort",
f"-cc={get_cctag()}",
f"--zip={get_ostag()}.zip",
"--keep",
]

retries = 3
success = False
for idx in range(retries):
p = subprocess.run(cmds)
if p.returncode == 0:
success = True
break
print(f"run {idx + 1}/{retries} failed...rerunning")
if not mfpymake_run_command(cmd):
raise RuntimeError("could not build the executables")

if not success:
raise RuntimeError("could not build the executables")
20 changes: 0 additions & 20 deletions .github/common/buildall.py

This file was deleted.

17 changes: 0 additions & 17 deletions .github/intel-scripts/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions .github/intel-scripts/cache_exclude_linux.sh

This file was deleted.

15 changes: 0 additions & 15 deletions .github/intel-scripts/cache_exclude_windows.sh

This file was deleted.

18 changes: 0 additions & 18 deletions .github/intel-scripts/ifortvars_linux.sh

This file was deleted.

15 changes: 0 additions & 15 deletions .github/intel-scripts/ifortvars_macos.sh

This file was deleted.

16 changes: 0 additions & 16 deletions .github/intel-scripts/ifortvars_windows.bat

This file was deleted.

23 changes: 0 additions & 23 deletions .github/intel-scripts/install_linux.sh

This file was deleted.

20 changes: 0 additions & 20 deletions .github/intel-scripts/install_macos.sh

This file was deleted.

15 changes: 0 additions & 15 deletions .github/intel-scripts/install_windows.bat

This file was deleted.

Loading