-
Notifications
You must be signed in to change notification settings - Fork 75
71 lines (71 loc) · 2.22 KB
/
actions.yml
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
name: plibsys-ci
on: [push, pull_request]
jobs:
main:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
CC: gcc
CXX: g++
USE_COV: '1'
- os: ubuntu-latest
CC: clang
CXX: clang++
USE_COV: '0'
- os: macos-latest
CC: clang
CXX: clang++
USE_COV: '1'
- os: macos-latest
CC: gcc-12
CXX: g++-12
USE_COV: '0'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: config
run: |
pwd
cd ..
mkdir ./plibsys-build
cd ./plibsys-build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${{ matrix.CC }} -DCMAKE_CXX_COMPILER=${{ matrix.CXX }} -DPLIBSYS_COVERAGE=ON ../plibsys
- name: build
run: |
pwd
cd ../plibsys-build
make -j
- name: test
run: |
pwd
cd ../plibsys-build
ctest
- name: coverage-install
if: ${{ success() && matrix.USE_COV == '1' && !github.event.issue.number }}
run: |
pwd
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update
sudo apt-get install lcov
echo "CODECOV_OS=linux" >> ${GITHUB_ENV}
elif [ "$RUNNER_OS" == "macOS" ]; then
brew update
brew install lcov
echo "CODECOV_OS=macos" >> ${GITHUB_ENV}
else
echo "Unknown operating system of runner"
exit 1
fi
pip install codecov-cli
- name: coverage-run
if: ${{ success() && matrix.USE_COV == '1' && !github.event.issue.number }}
run: |
pwd
codecovcli create-commit -t ${{ secrets.CODECOV_TOKEN }}
lcov -c --directory ../plibsys-build --no-external --base-directory . --output-file ../plibsys-build/coverage.info
codecovcli -v create-report -t ${{ secrets.CODECOV_TOKEN }}
codecovcli -v do-upload --dir ../plibsys-build --name github-${{ env.CODECOV_OS }} -t ${{ secrets.CODECOV_TOKEN }}