-
Notifications
You must be signed in to change notification settings - Fork 72
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 #412 from llaniewski/feature/actions
Working GitHub Actions tests with coverage
- Loading branch information
Showing
13 changed files
with
319 additions
and
36 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,12 @@ | ||
name: 'TCLB Test' | ||
description: 'This action tests TCLB' | ||
inputs: | ||
model: | ||
description: model to compile | ||
default: 'd2q9' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- shell: bash | ||
id: compile | ||
run: make ${{ inputs.model }} |
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,76 @@ | ||
name: 'TCLB Test' | ||
description: 'This action tests TCLB' | ||
inputs: | ||
gpu: | ||
description: compile a GPU version | ||
default: false | ||
cuda_arch: | ||
description: CUDA arch (sm_) to use | ||
default: 'sm_50' | ||
precision: | ||
description: compute precision to use | ||
default: 'double' | ||
rinside: | ||
description: compute precision to use | ||
default: false | ||
marklines: | ||
description: compute precision to use | ||
default: true | ||
coverage: | ||
description: compute precision to use | ||
default: false | ||
paranoid: | ||
description: compute precision to use | ||
default: true | ||
python: | ||
description: compute precision to use | ||
default: false | ||
options: | ||
description: other configure options | ||
default: '' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- shell: bash | ||
id: compile | ||
run: | | ||
make configure | ||
CONFOPT="" | ||
case "${{ inputs.gpu }}" in | ||
true) CONFOPT="$CONFOPT --enable-cuda --with-cuda-arch=${{ inputs.cuda_arch }}" ;; | ||
false) CONFOPT="$CONFOPT --disable-cuda" ;; | ||
*) echo "Wrong 'gpu' input in configure action"; exit -1 | ||
esac | ||
case "${{ inputs.precision }}" in | ||
double) CONFOPT="$CONFOPT --enable-double" ;; | ||
float) CONFOPT="$CONFOPT --disable-double" ;; | ||
*) echo "Wrong 'precision' input in configure action"; exit -1 | ||
esac | ||
case "${{ inputs.rinside }}" in | ||
true) CONFOPT="$CONFOPT --enable-rinside" ;; | ||
false) CONFOPT="$CONFOPT --disable-rinside" ;; | ||
*) echo "Wrong 'rinside' input in configure action"; exit -1 | ||
esac | ||
case "${{ inputs.marklines }}" in | ||
true) CONFOPT="$CONFOPT --enable-marklines" ;; | ||
false) CONFOPT="$CONFOPT --disable-marklines" ;; | ||
*) echo "Wrong 'marklines' input in configure action"; exit -1 | ||
esac | ||
case "${{ inputs.coverage }}" in | ||
true) CONFOPT="$CONFOPT --enable-coverage" ;; | ||
false) CONFOPT="$CONFOPT --disable-coverage" ;; | ||
*) echo "Wrong 'coverage' input in configure action"; exit -1 | ||
esac | ||
case "${{ inputs.paranoid }}" in | ||
true) CONFOPT="$CONFOPT --enable-paranoid" ;; | ||
false) CONFOPT="$CONFOPT --disable-paranoid" ;; | ||
*) echo "Wrong 'paranoid' input in configure action"; exit -1 | ||
esac | ||
case "${{ inputs.python }}" in | ||
true) CONFOPT="$CONFOPT --with-python" ;; | ||
false) CONFOPT="$CONFOPT --without-python" ;; | ||
*) echo "Wrong 'python' input in configure action"; exit -1 | ||
esac | ||
CONFOPT="$CONFOPT ${{ inputs.options }}" | ||
echo "Configure options:$CONFOPT" | ||
./configure $CONFOPT |
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,21 @@ | ||
name: 'TCLB Coverage' | ||
description: 'This action gatheres coverage data for TCLB' | ||
outputs: | ||
reports: | ||
description: "Report files" | ||
value: ${{ steps.gather.outputs.reports }} | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- shell: bash | ||
id: gather | ||
run: | | ||
lcov --capture --directory . --output-file coverage.info | ||
if test -s coverage.info | ||
then | ||
lcov --remove coverage.info '/usr/*' --output-file coverage.info | ||
lcov --list coverage.info | ||
echo "reports=coverage.info" >> $GITHUB_OUTPUT | ||
else | ||
echo "reports=" >> $GITHUB_OUTPUT | ||
fi |
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,95 @@ | ||
name: 'TCLB Install' | ||
description: 'This action installes TCLB dependencies' | ||
inputs: | ||
essentials: | ||
description: install essentials | ||
default: false | ||
r: | ||
description: install r | ||
default: true | ||
rdep: | ||
description: install rdep | ||
default: true | ||
rpython: | ||
description: install rpython | ||
default: false | ||
reticulate: | ||
description: install reticulate | ||
default: false | ||
rinside: | ||
description: install rinside | ||
default: false | ||
cuda: | ||
description: install cuda | ||
default: false | ||
openmpi: | ||
description: install openmpi | ||
default: true | ||
lcov: | ||
description: install lcov | ||
default: false | ||
submodules: | ||
description: install submodules | ||
default: false | ||
gitdep: | ||
description: install gitdep | ||
default: false | ||
python-dev: | ||
description: install python-dev | ||
default: false | ||
module: | ||
description: install module | ||
default: false | ||
tapenade: | ||
description: install tapenade | ||
default: false | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- if: inputs.essentials != 'false' | ||
shell: bash | ||
run: tools/install.sh --sudo essentials | ||
- if: inputs.r != 'false' | ||
shell: bash | ||
run: tools/install.sh --sudo r | ||
- if: inputs.rdep != 'false' | ||
shell: bash | ||
run: tools/install.sh --sudo rdep | ||
- if: inputs.rpython != 'false' | ||
shell: bash | ||
run: tools/install.sh --sudo rpython | ||
- if: inputs.reticulate != 'false' | ||
shell: bash | ||
run: tools/install.sh --sudo reticulate | ||
- if: inputs.rinside != 'false' | ||
shell: bash | ||
run: tools/install.sh --sudo rinside | ||
- if: inputs.cuda != 'false' | ||
shell: bash | ||
run: | | ||
tools/install.sh --sudo cuda ${{ inputs.cuda }} | ||
CUDA_PATH=/usr/local/cuda-${{ inputs.cuda }} | ||
echo "$CUDA_PATH/bin" >>$GITHUB_PATH | ||
echo "LD_LIBRARY_PATH=$CUDA_PATH/lib64:$LD_LIBRARY_PATH" >>$GITHUB_ENV | ||
echo "CUDA_PATH=$CUDA_PATH" >>$GITHUB_OUTPUT | ||
- if: inputs.openmpi != 'false' | ||
shell: bash | ||
run: tools/install.sh --sudo openmpi | ||
- if: inputs.lcov != 'false' | ||
shell: bash | ||
run: tools/install.sh --sudo lcov | ||
- if: inputs.submodules != 'false' | ||
shell: bash | ||
run: tools/install.sh --sudo submodules | ||
- if: inputs.gitdep != 'false' | ||
shell: bash | ||
run: tools/install.sh --sudo gitdep | ||
- if: inputs.python-dev != 'false' | ||
shell: bash | ||
run: tools/install.sh --sudo python-dev | ||
- if: inputs.module != 'false' | ||
shell: bash | ||
run: tools/install.sh --sudo module | ||
- if: inputs.tapenade != 'false' | ||
shell: bash | ||
run: tools/install.sh --sudo tapenade |
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,11 @@ | ||
name: 'TCLB Test' | ||
description: 'This action tests TCLB' | ||
inputs: | ||
model: | ||
description: model to compile | ||
default: 'd2q9' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- shell: bash | ||
run: tools/tests.sh ${{ inputs.model }} |
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,49 @@ | ||
name: CPU | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
model: [d2q9_npe_guo, d2q9_bc, d2q9, d2q9_SRT, d2q9_thin_film, d3q19, d3q19_les, d3q19_heat, d2q9_kuper, d2q9_pf, d2q9_pf_fd, d3q27, d3q27_cumulant, d3q27_cumulant_AVG_IB_SMAG] | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Install dependencies | ||
uses: ./.github/actions/install | ||
with: | ||
r: true | ||
rdep: true | ||
openmpi: true | ||
python-dev: true | ||
rinside: true | ||
lcov: true | ||
- name: Configure | ||
uses: ./.github/actions/configure | ||
with: | ||
gpu: false | ||
python: true | ||
paranoid: true | ||
coverage: true | ||
- name: Compile | ||
uses: ./.github/actions/compile | ||
with: | ||
model: ${{ matrix.model }} | ||
- name: Run tests | ||
uses: ./.github/actions/test | ||
with: | ||
model: ${{ matrix.model }} | ||
- name: Gather coverage data | ||
uses: ./.github/actions/coverage | ||
id: coverage | ||
- name: Send coverage data | ||
uses: codecov/codecov-action@v3 | ||
if: steps.coverage.outputs.reports != '' | ||
with: | ||
files: ${{ steps.coverage.outputs.reports }} | ||
flags: ${{ matrix.model }} |
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,34 @@ | ||
name: GPU | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
model: [d2q9_npe_guo, d2q9_bc, d2q9, d2q9_SRT, d2q9_thin_film, d3q19, d3q19_les, d3q19_heat, d2q9_kuper, d2q9_pf, d2q9_pf_fd, d3q27, d3q27_cumulant, d3q27_cumulant_AVG_IB_SMAG] | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- name: Install dependencies | ||
uses: ./.github/actions/install | ||
with: | ||
r: true | ||
rdep: true | ||
openmpi: true | ||
rinside: true | ||
cuda: 11.7 | ||
- name: Configure | ||
uses: ./.github/actions/configure | ||
with: | ||
gpu: true | ||
cuda_arch: sm_60 | ||
paranoid: true | ||
- name: Compile | ||
uses: ./.github/actions/compile | ||
with: | ||
model: ${{ matrix.model }} |
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
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
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
Oops, something went wrong.