Skip to content

Commit

Permalink
Add actions setup for testing and docs (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
awvwgk authored Jan 17, 2021
1 parent d38202c commit f860bf8
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/dco.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
require:
members: false
95 changes: 95 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: CI

on: [push, pull_request]

jobs:
gcc-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

env:
FC: gfortran
GCC_V: 9

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

- uses: actions/setup-python@v1
with:
python-version: '3.x'

- name: Install GCC (OSX)
if: contains(matrix.os, 'macos')
run: |
ln -s /usr/local/bin/gfortran-${GCC_V} /usr/local/bin/gfortran
which gfortran-${GCC_V}
which gfortran
- name: Install GCC (Linux)
if: contains(matrix.os, 'ubuntu')
run: |
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${GCC_V} 100 \
--slave /usr/bin/gfortran gfortran /usr/bin/gfortran-${GCC_V} \
--slave /usr/bin/gcov gcov /usr/bin/gcov-${GCC_V}
- name: Install meson
run: pip3 install meson ninja

- name: Configure build
run: meson setup _build

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

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


intel-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]

env:
FC: ifort
OMP_NUM_THREADS: 2,1

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

- uses: actions/setup-python@v1
with:
python-version: '3.x'

- name: Add Intel repository
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
- name: Install Intel oneAPI compiler
run: |
sudo apt-get install intel-oneapi-ifort
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- name: Install meson
run: pip3 install meson ninja

- name: Configure meson build
run: meson setup build

- name: Build library
run: meson compile -C build

- name: Run unit tests
run: meson test -C build --print-errorlogs --no-rebuild
23 changes: 23 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: docs

on: [push, pull_request]

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: pip install ford
- name: Build Documentation
run: ford docs.md
- uses: JamesIves/github-pages-deploy-action@3.7.1
if: github.event_name == 'push' && github.repository == 'grimme-lab/rmsd-tool' && ( startsWith( github.ref, 'refs/tags/' ) || github.ref == 'refs/heads/main' )
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: _docs
CLEAN: true
3 changes: 2 additions & 1 deletion docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ project_download: https://github.com/grimme-lab/rmsd-tool/releases
author: Grimme group, Bonn
github: https://github.com/grimme-lab
src_dir: ./src
output_dir: ./docs
./app
output_dir: ./_docs
exclude_dir: ./test
docmark: <
predocmark: >
Expand Down

0 comments on commit f860bf8

Please sign in to comment.