-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add test-fortran github action * install gfortran based on https://github.com/fortran-lang/fpm/blob/master/.github/workflows/CI.yml * fix workflow * fix workflow (2) * fix workflow (3) * add windows to test matrix * use ninja on windows build * fix workflow (4) * try nmake generator * fix quotes? * refactor workflow * fix workflow (x) * fix workflow (y) * add mingw build * do not install git and fypp * add doc test build workflow * add deploy doc github action * add test python bindings workflow * add python build on windows * fix wrong compiler conda package name * try fix python build on windows * try fix python build on windows (2) * windooows * use cmd shell and use conda instead of mamba mamba-org/mamba#897 * WTF * use cmd shell (really) * cmd multiline run doesn't work https://github.community/t/windows-multi-line-step-run/16136/8 * ... * back to bash * back to cmmmmddd * next try * fix FC? * WTF2 * remove travis ci * update README badges
- Loading branch information
Showing
6 changed files
with
212 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: deploy-doc | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
adoc-build-deploy: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Build docs | ||
uses: avattathil/asciidoctor-action@v2 | ||
with: | ||
program: "asciidoctor docs/index.adoc -o docs/index.html" | ||
- name: Deploy docs to gh-pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_branch: gh-pages | ||
publish_dir: ./docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: test-doc | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
pull_request: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
adoc-build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Build docs | ||
uses: avattathil/asciidoctor-action@v2 | ||
with: | ||
program: "asciidoctor docs/index.adoc -o docs/index.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: test-fortran | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
pull_request: | ||
branches: | ||
- 'master' | ||
|
||
env: | ||
HOMEBREW_NO_ANALYTICS: "ON" # Make Homebrew installation a little quicker | ||
HOMEBREW_NO_AUTO_UPDATE: "ON" | ||
HOMEBREW_NO_BOTTLE_SOURCE_FALLBACK: "ON" | ||
HOMEBREW_NO_GITHUB_API: "ON" | ||
HOMEBREW_NO_INSTALL_CLEANUP: "ON" | ||
BUILD_DIR: _build | ||
CMAKE_OPTIONS: >- | ||
-DBUILD_EXAMPLES=ON -DBUILD_FASTSCAPELIB_SHARED=ON -DCMAKE_BUILD_TYPE=Debug | ||
jobs: | ||
gcc-build: | ||
name: gcc (${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set Compiler (Linux) | ||
if: contains(matrix.os, 'ubuntu') | ||
run: | | ||
echo "FC=gfortran" >> $GITHUB_ENV | ||
echo "CC=gcc" >> $GITHUB_ENV | ||
- name: Set Compiler (MacOS) | ||
if: contains(matrix.os, 'macos') | ||
run: | | ||
echo "FC=gfortran-9" >> $GITHUB_ENV | ||
echo "CC=gcc-9" >> $GITHUB_ENV | ||
- name: Configure build | ||
run: cmake -B ${BUILD_DIR} ${CMAKE_OPTIONS} | ||
|
||
- name: Build project | ||
run: cmake --build ${BUILD_DIR} | ||
|
||
- name: Run Fan example | ||
run: | | ||
cd ${BUILD_DIR}/examples | ||
./Fan | ||
mingw-build: | ||
name: mingw (windows-latest) | ||
runs-on: windows-latest | ||
defaults: | ||
run: | ||
shell: msys2 {0} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: MINGW64 | ||
update: false | ||
install: >- | ||
mingw-w64-x86_64-gcc-fortran | ||
mingw-w64-x86_64-cmake | ||
mingw-w64-x86_64-ninja | ||
- name: Configure build | ||
run: cmake -B ${BUILD_DIR} -G Ninja ${CMAKE_OPTIONS} | ||
env: | ||
FC: gfortran | ||
CC: gcc | ||
|
||
- name: Build project | ||
run: cmake --build ${BUILD_DIR} | ||
|
||
- name: Run Fan example | ||
run: | | ||
cd ${BUILD_DIR}/examples | ||
./Fan.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: test-python | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'master' | ||
pull_request: | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
unix: | ||
name: 3.8 (${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
|
||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip wheel setuptools | ||
python -m pip install numpy scikit-build ninja | ||
- name: Set Compiler (Linux) | ||
if: contains(matrix.os, 'ubuntu') | ||
run: | | ||
echo "FC=gfortran" >> $GITHUB_ENV | ||
echo "CC=gcc" >> $GITHUB_ENV | ||
- name: Set Compiler (MacOS) | ||
if: contains(matrix.os, 'macos') | ||
run: | | ||
echo "FC=gfortran-9" >> $GITHUB_ENV | ||
echo "CC=gcc-9" >> $GITHUB_ENV | ||
- name: Build and install Python bindings | ||
run: python -m pip install . -v --no-build-isolation --no-deps --ignore-installed --no-cache-dir | ||
|
||
- name: Test import Python module | ||
run: python -c "import sys; sys.path.pop(0); import fastscapelib_fortran" | ||
|
||
windows: | ||
name: 3.8 (windows-latest) | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Conda | ||
uses: conda-incubator/setup-miniconda@v2 | ||
with: | ||
python-version: 3.8 | ||
miniforge-version: latest | ||
|
||
- name: Install dependencies | ||
shell: cmd | ||
run: | | ||
conda create -n test python=3.8 cmake c-compiler fortran-compiler scikit-build pip wheel setuptools numpy | ||
- name: Build and install project | ||
shell: cmd | ||
run: >- | ||
conda activate test && | ||
ls %CONDA%\envs\test && | ||
ls %CONDA%\envs\test\Library\bin && | ||
set FC="C:/Miniconda3/envs/test/Library/bin/flang.exe" && | ||
python setup.py bdist_wheel --dist-dir="dist" -G "NMake Makefiles" -- -DCMAKE_Fortran_COMPILER:FILEPATH="%FC%" && | ||
python -m pip install --no-index --find-links="dist" fastscapelib_fortran -vvv | ||
- name: Test import Python module | ||
run: python -c "import sys; sys.path.pop(0); import fastscapelib_fortran" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters