Skip to content

Commit

Permalink
Merge pull request #7 from KrisThielemans/addCI
Browse files Browse the repository at this point in the history
add GitHub Action workflow for basic testing
  • Loading branch information
KrisThielemans authored Oct 10, 2023
2 parents 590c423 + 612fda0 commit efcd428
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/actions/configure-environment/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Configure Environment
description: Configures the conda environment
runs:
using: composite
steps:

- name: Initial setup
shell: bash
run: |
# filter conda environment file
cat environment.yml | grep -v "#.*\<\local\>" > ci-environment.yml
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: yardl
environment-file: ci-environment.yml
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: CI

on:
push:
branches: [main]
paths-ignore:
- '**/*.md'
pull_request:
branches: [main]

defaults:
run:
# See https://github.com/marketplace/actions/setup-miniconda#important
shell: bash -el {0}

jobs:
validate:
strategy:
matrix:
cppVersion: [17]

name: Validate C++${{ matrix.cppVersion }}
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Configure environment
uses: ./.github/actions/configure-environment

- name: Install yardl
run: |
YARDL_DIR=${{github.workspace}}/yardl
mkdir ${YARDL_DIR}
cd ${YARDL_DIR}
echo "${{github.workspace}}/yardl" >> $GITHUB_PATH
YARDL_VERSION=0.3.0
wget --quiet "https://github.com/microsoft/yardl/releases/download/v${YARDL_VERSION}/yardl_${YARDL_VERSION}_linux_x86_64.tar.gz"
tar -xzf "yardl_${YARDL_VERSION}_linux_x86_64.tar.gz"
rm "yardl_${YARDL_VERSION}_linux_x86_64.tar.gz"
- name: Build model
run: |
cd model
yardl generate
- name: Python
run: |
cd python
python prd_generator.py | python prd_analysis.py
- name: Cpp
run: |
cd cpp && mkdir -p build && cd build
cmake -G Ninja -S .. -DHDF5_ROOT="$CONDA_PREFIX"
ninja
./prd_generator test.h5
./prd_analysis test.h5

0 comments on commit efcd428

Please sign in to comment.