-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from KrisThielemans/addCI
add GitHub Action workflow for basic testing
- Loading branch information
Showing
2 changed files
with
74 additions
and
0 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,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 |
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,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 |