-
Notifications
You must be signed in to change notification settings - Fork 50
150 lines (142 loc) · 6.83 KB
/
coverage.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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: coverage
defaults:
#if: "!contains(github.event.head_commit.message, 'skip ci')" # SKIP
run:
# Use a bash shell so we can use the same syntax for environment variable
# access regardless of the host operating system
shell: bash -e -x {0}
on:
# https://github.community/t/how-to-trigger-an-action-on-push-or-pull-request-but-not-both/16662
workflow_dispatch:
push:
branches:
- master
pull_request:
branches:
- master
env:
PROJ_PFX_TARGET: c4core-
PROJ_PFX_CMAKE: C4CORE_
CMAKE_FLAGS:
NUM_JOBS_BUILD: # 4
jobs:
#----------------------------------------------------------------------------
coverage:
name: coverage/${{matrix.name}}
# if: github.ref == 'refs/heads/master'
continue-on-error: true
if: always() # https://stackoverflow.com/questions/62045967/github-actions-is-there-a-way-to-continue-on-error-while-still-getting-correct
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
include:
- {name: c++11, std: 11, cxx: g++-9, cc: gcc-9, bt: Coverage, os: ubuntu-20.04}
- {name: c++17, std: 17, cxx: g++-9, cc: gcc-9, bt: Coverage, os: ubuntu-20.04}
#- {name: c++20, std: 20, cxx: g++-9, cc: gcc-9, bt: Coverage, os: ubuntu-20.04}
env: {
STD: "${{matrix.std}}", CXX_: "${{matrix.cxx}}", BT: "${{matrix.bt}}", BITLINKS: "${{matrix.bitlinks}}", VG: "${{matrix.vg}}", SAN: "${{matrix.san}}", LINT: "${{matrix.lint}}", OS: "${{matrix.os}}",
CODECOV_TOKEN: "${{secrets.CODECOV_TOKEN}}",
COVERALLS_REPO_TOKEN: "${{secrets.COVERALLS_REPO_TOKEN}}",
COVERALLS_PARALLEL: true,
}
steps:
- {name: checkout, uses: actions/checkout@v3, with: {submodules: recursive}}
- {name: install requirements, run: source .github/reqs.sh && c4_install_test_requirements $OS}
- {name: show info, run: source .github/setenv.sh && c4_show_info}
- name: static64-configure---------------------------------------------------
run: source .github/setenv.sh && c4_cfg_test static64
- {name: static64-build, run: source .github/setenv.sh && c4_build_test static64}
- {name: static64-run, run: source .github/setenv.sh && c4_build_target static64 c4core-coverage}
- name: static64-coverage-artifacts
uses: actions/upload-artifact@v3
with:
name: coverage-static64-cxx${{matrix.std}}
path: |
build/static64/lcov/
build/static64/coverage3-final_filtered.lcov
- {name: static64-submit-codecov, run: source .github/setenv.sh && c4_submit_coverage static64 codecov}
- {name: static64-submit-coveralls, run: source .github/setenv.sh && c4_submit_coverage static64 coveralls,
env: {COVERALLS_FLAG_NAME: "${{matrix.name}}/static64"}}
- name: static32-configure---------------------------------------------------
run: source .github/setenv.sh && c4_cfg_test static32
- {name: static32-build, run: source .github/setenv.sh && c4_build_test static32}
- {name: static32-run, run: source .github/setenv.sh && c4_build_target static32 c4core-coverage}
- name: static32-coverage-artifacts
uses: actions/upload-artifact@v3
with:
name: coverage-static32-cxx${{matrix.std}}
path: |
build/static32/lcov/
build/static32/coverage3-final_filtered.lcov
- {name: static32-submit-codecov, run: source .github/setenv.sh && c4_submit_coverage static32 codecov}
- {name: static32-submit-coveralls, run: source .github/setenv.sh && c4_submit_coverage static32 coveralls,
env: {COVERALLS_FLAG_NAME: "${{matrix.name}}/static32"}}
#----------------------------------------------------------------------------
coverage_nofastfloat:
name: coverage/${{matrix.name}}
# if: github.ref == 'refs/heads/master'
continue-on-error: true
if: always() # https://stackoverflow.com/questions/62045967/github-actions-is-there-a-way-to-continue-on-error-while-still-getting-correct
runs-on: ${{matrix.os}}
strategy:
fail-fast: false
matrix:
include:
- {name: nofastfloat/c++11, std: 11, cxx: g++-9, cc: gcc-9, bt: Coverage, os: ubuntu-20.04}
- {name: nofastfloat/c++17, std: 17, cxx: g++-9, cc: gcc-9, bt: Coverage, os: ubuntu-20.04}
env: {
STD: "${{matrix.std}}",
CXX_: "${{matrix.cxx}}",
BT: "${{matrix.bt}}",
OS: "${{matrix.os}}",
CODECOV_TOKEN: "${{secrets.CODECOV_TOKEN}}",
COVERALLS_REPO_TOKEN: "${{secrets.COVERALLS_REPO_TOKEN}}",
COVERALLS_PARALLEL: true, # https://docs.coveralls.io/parallel-build-webhook
COVERALLS_FLAG_NAME: "${{matrix.name}}",
BDIR: "build/nofastfloat-${{matrix.cxx}}-cxx${{matrix.std}}",
IDIR: "install/nofastfloat-${{matrix.cxx}}-cxx${{matrix.std}}",
}
steps:
- {name: checkout, uses: actions/checkout@v3, with: {submodules: recursive}}
- {name: install requirements, run: source .github/reqs.sh && c4_install_test_requirements $OS}
- {name: show info, run: source .github/setenv.sh && c4_show_info}
- name: nofastfloat-configure------------------------------------------------
run: |
set -x
mkdir -p $BDIR
mkdir -p $IDIR
cmake -S . -B $BDIR \
-DC4CORE_WITH_FASTFLOAT=OFF \
-DC4_CXX_STANDARD=${{matrix.std}} \
-DC4CORE_CXX_STANDARD=${{matrix.std}} \
-DC4CORE_BUILD_TESTS=ON \
-DC4CORE_VALGRIND=OFF \
-DC4CORE_COVERAGE_CODECOV=ON \
-DC4CORE_COVERAGE_COVERALLS=ON \
-DCMAKE_INSTALL_PREFIX=$IDIR \
-DCMAKE_BUILD_TYPE=Coverage \
-DCMAKE_CXX_COMPILER=${{matrix.cxx}} \
-DCMAKE_C_COMPILER=${{matrix.cc}}
- {name: nofastfloat-build, run: cmake --build $BDIR --config Coverage --target c4core-test-build -j}
- {name: nofastfloat-run, run: cmake --build $BDIR --config Coverage --target c4core-coverage}
- name: nofastfloat-coverage-artifacts
uses: actions/upload-artifact@v3
with:
name: coverage-shared32
path: |
build/nofastfloat-${{matrix.cxx}}-cxx${{matrix.std}}/lcov/
build/nofastfloat-${{matrix.cxx}}-cxx${{matrix.std}}/coverage3-final_filtered.lcov
- {name: nofastfloat-submit-codecov, run: cmake --build $BDIR --config Coverage --target c4core-coverage-submit-codecov}
- {name: nofastfloat-submit-coveralls, run: cmake --build $BDIR --config Coverage --target c4core-coverage-submit-coveralls}
# https://github.com/marketplace/actions/coveralls-github-action
coveralls_finish:
needs: [coverage, coverage_nofastfloat]
runs-on: ubuntu-latest
steps:
- name: coveralls-notify
continue-on-error: true
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true