-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (98 loc) · 2.91 KB
/
build.yml
File metadata and controls
114 lines (98 loc) · 2.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
runs-on: ${{ matrix.os }}
steps:
- name: Set up miniconda
uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.11
auto-update-conda: false
channels: andrsd,defaults
- name: Checkout source
uses: actions/checkout@v6
- name: Install dependencies
run: |
conda install \
cmake \
make \
mpich-mpicxx \
exodusii==2024.06.* \
fmt=11.* \
yaml-cpp==0.8.0 \
pybind11 \
pytest \
flake8 \
gtest \
lcov
- name: Configure
run: |
cmake -S . -B ${{ github.workspace }}/build \
-DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-DGCOV_PATH=`which x86_64-conda-linux-gnu-gcov` \
-DEXODUSIICPP_LIBRARY_TYPE=SHARED \
-DEXODUSIICPP_WITH_PYTHON=ON \
-DEXODUSIICPP_BUILD_TESTS=YES \
-DEXODUSIICPP_CODE_COVERAGE=YES
- name: Build
run: cmake --build ${{ github.workspace }}/build
- name: Install
run: cmake --install ${{ github.workspace }}/build
- name: Run C++ tests
run: |
${{ github.workspace }}/build/test/exodusIIcpp-test \
--gtest_output=xml:${{ github.workspace }}/build/gtest-results.xml
- name: Run Python tests
run: |
pytest ${{ github.workspace }}/python/tests
- name: Test summary
uses: test-summary/action@v2
if: always()
with:
paths: ${{ github.workspace }}/build/gtest-results.xml
show: "fail, skip"
- name: Upload test results to codecov.io
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ${{ github.workspace }}/build/gtest-results.xml
name: ${{ matrix.os }}
- name: Generate code coverage
if: startsWith(matrix.os, 'ubuntu')
run: |
make -C ${{ github.workspace }}/build coverage
- name: Upload coverage artifact
if: startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v7
with:
name: coverage-${{ matrix.os }}
path: ${{ github.workspace }}/build/coverage.info
upload-to-codecov:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download artifacts
uses: actions/download-artifact@v8
- name: Upload to Codecov
uses: codecov/codecov-action@v6
with:
token: ${{ secrets.CODECOV_TOKEN }}