Skip to content

Commit

Permalink
Merge pull request #5 from awvwgk/ci
Browse files Browse the repository at this point in the history
Add testing workflow via GH actions
  • Loading branch information
yizhang-yiz committed Feb 3, 2022
2 parents cf739e3 + 11f87a1 commit 373a63d
Show file tree
Hide file tree
Showing 31 changed files with 91 additions and 26 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI
on: [push, pull_request]

jobs:
Build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
gcc: [11] # Version of GFortran we want to use.

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install GFortran (MacOS)
if: ${{ contains(matrix.os, 'macos') }}
run: |
brew install gcc@${{ matrix.gcc }}
ln -s /usr/local/bin/gfortran-${{ matrix.gcc }} /usr/local/bin/gfortran
- name: Install GFortran (Linux)
if: ${{ contains(matrix.os, 'ubuntu') }}
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y gcc-${{ matrix.gcc }} gfortran-${{ matrix.gcc }}
sudo update-alternatives \
--install /usr/bin/gcc gcc /usr/bin/gcc-${{ matrix.gcc }} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${{ matrix.gcc }} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${{ matrix.gcc }}
- name: Install GFortran (Windows)
if: ${{ contains(matrix.os, 'windows') }}
run: |
Invoke-WebRequest -Uri ${{ env.DOWNLOAD }} -OutFile mingw-w64.zip
Expand-Archive mingw-w64.zip
echo "$pwd\mingw-w64\mingw64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
env:
DOWNLOAD: "https://github.com/brechtsanders/winlibs_mingw/releases/download/11.2.0-9.0.0-ucrt-r4/winlibs-x86_64-posix-seh-gcc-11.2.0-mingw-w64ucrt-9.0.0-r4.zip"

- name: Set up Python 3.x
uses: actions/setup-python@v1 # Use pip to install latest CMake, & FORD/Jin2For, etc.
with:
python-version: ${{ matrix.python-version }}

- name: Install meson
run: pip3 install ${{ env.PACKAGES }}
env:
PACKAGES: >-
meson==0.59
ninja
- name: Configure build
run: meson setup _build --prefix=$PWD/fazang --default-library=static

- name: Build project
run: meson compile -C _build

- name: Run tests
run: meson test -C _build --print-errorlogs --no-rebuild

- name: Install project
run: meson install -C _build --no-rebuild
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 26 additions & 26 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@ sources = ['env.F90',
'tape.F90',
'nested.F90',
'vari.F90',
'test.f90',
'var.f90',
'grad.f90',
'sin.f90',
'cos.f90',
'tan.f90',
'asin.f90',
'acos.f90',
'atan.f90',
'sqrt.f90',
'inv.f90',
'square.f90',
'inv_square.f90',
'inv_sqrt.f90',
'exp.f90',
'log.f90',
'test.F90',
'var.F90',
'grad.F90',
'sin.F90',
'cos.F90',
'tan.F90',
'asin.F90',
'acos.F90',
'atan.F90',
'sqrt.F90',
'inv.F90',
'square.F90',
'inv_square.F90',
'inv_sqrt.F90',
'exp.F90',
'log.F90',
'relational.F90',
'add.f90',
'sub.f90',
'mul.f90',
'div.f90',
'pow.f90',
'sum.f90',
'log_sum_exp.f90',
'dot_product.f90',
'matmul.f90',
'fazang.f90']
'add.F90',
'sub.F90',
'mul.F90',
'div.F90',
'pow.F90',
'sum.F90',
'log_sum_exp.F90',
'dot_product.F90',
'matmul.F90',
'fazang.F90']

fazanglib = library('fazang', sources, install: true)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 373a63d

Please sign in to comment.