1+ name : Build PETSc (Windows)
2+ description : Build PETSc on Windows with Cygwin
3+ runs :
4+ using : " composite"
5+ steps :
6+
7+ - name : Convert line endings
8+ shell : cmd
9+ run : |
10+ unix2dos -n "%GITHUB_WORKSPACE%\modflow6\.github\common\configure_petsc.sh" "%TEMP%\configure_petsc.sh"
11+ unix2dos -n "%GITHUB_WORKSPACE%\modflow6\.github\common\compile_petsc.sh" "%TEMP%\compile_petsc.sh"
12+
13+ - name : Hide Strawberry programs
14+ shell : bash
15+ run : |
16+ mkdir "$RUNNER_TEMP/strawberry"
17+ mv /c/Strawberry/c/bin/gmake "$RUNNER_TEMP/strawberry/gmake"
18+ mv /c/Strawberry/perl/bin/pkg-config "$RUNNER_TEMP/strawberry/pkg-config"
19+ mv /c/Strawberry/perl/bin/pkg-config.bat "$RUNNER_TEMP/strawberry/pkg-config.bat"
20+
21+ - name : Get date
22+ id : get-date
23+ shell : bash
24+ run : echo "date=$(/bin/date -u "+%Y%m%d")" >> "$GITHUB_OUTPUT"
25+
26+ - name : Setup oneAPI
27+ uses : ./modflow6/.github/actions/setup-par-oneapi
28+
29+ - name : Restore PETSc cache
30+ id : petsc-cache
31+ uses : actions/cache/restore@v3
32+ with :
33+ path : petsc
34+ key : petsc-${{ runner.os }}-${{ steps.get-date.outputs.date }}
35+
36+ - name : Download PETSc
37+ if : steps.petsc-cache.outputs.cache-hit != 'true'
38+ shell : bash
39+ run : |
40+ curl https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-3.20.5.tar.gz -O -J
41+ mkdir petsc
42+ tar -xzf petsc-3.20.5.tar.gz -C petsc --strip-components=1
43+
44+ - name : Setup Cygwin
45+ if : steps.petsc-cache.outputs.cache-hit != 'true'
46+ uses : egor-tensin/setup-cygwin@v4
47+ with :
48+ packages : python3 make gcc-core gcc-g++ pkg-config
49+
50+ - name : Hide Cygwin linker
51+ if : steps.petsc-cache.outputs.cache-hit != 'true'
52+ shell : C:\tools\cygwin\bin\bash.exe --login --norc -eo pipefail -o igncr '{0}'
53+ run : mv /usr/bin/link.exe /usr/bin/link-cygwin.exe
54+
55+ - name : Configure PETSc
56+ if : steps.petsc-cache.outputs.cache-hit != 'true'
57+ shell : cmd
58+ run : |
59+ "%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "C:\tools\cygwin\bin\bash.exe" --login --norc -eo pipefail -o igncr "%TEMP%\configure_petsc.sh"
60+
61+ - name : Build PETSc
62+ if : steps.petsc-cache.outputs.cache-hit != 'true'
63+ shell : cmd
64+ run : |
65+ "%ONEAPI_ROOT%\setvars.bat" intel64 vs2022 && "C:\tools\cygwin\bin\bash.exe" --login --norc -eo pipefail -o igncr "%TEMP%\compile_petsc.sh"
66+
67+ - name : Save PETSc cache
68+ if : steps.petsc-cache.outputs.cache-hit != 'true'
69+ uses : actions/cache/save@v3
70+ with :
71+ path : petsc
72+ key : petsc-${{ runner.os }}-${{ steps.get-date.outputs.date }}
73+
74+ - name : Setup PETSC environment
75+ shell : cmd
76+ run : |
77+ set PETSC_DIR=%GITHUB_WORKSPACE%\petsc
78+ set PETSC_ARCH=arch-mswin-c-opt
79+ echo PETSC_DIR=%PETSC_DIR%>>%GITHUB_ENV%
80+ echo PETSC_ARCH=%PETSC_ARCH%>>%GITHUB_ENV%
81+ echo %PETSC_DIR%\%PETSC_ARCH%\lib>>%GITHUB_PATH%
0 commit comments