-
Notifications
You must be signed in to change notification settings - Fork 63
74 lines (72 loc) · 2.62 KB
/
cpp-tests.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
name: C++ tests
on:
workflow_call:
inputs:
compiler-ref:
required: false
type: string
runtime-ref:
required: false
type: string
all-platforms:
required: false
default: true
type: boolean
jobs:
regular-tests:
strategy:
matrix:
platform: ${{ (inputs.all-platforms && fromJSON('["ubuntu-latest", "macos-latest", "windows-latest"]')) || fromJSON('["ubuntu-latest"]') }}
runs-on: ${{ matrix.platform }}
timeout-minutes: 120
steps:
- name: Check out lingua-franca repository
uses: actions/checkout@v3
with:
repository: lf-lang/lingua-franca
submodules: true
ref: ${{ inputs.compiler-ref }}
fetch-depth: 0
- name: Prepare build environment
uses: ./.github/actions/prepare-build-env
- name: Install Dependencies OS X
run: brew install coreutils
if: runner.os == 'macOS'
- name: Install clang-tidy and lcov on Ubuntu
run: |
sudo apt-get update
sudo apt-get install -y clang-tidy
sudo apt-get install -y lcov
if: matrix.platform == 'ubuntu-latest'
- name: Check out specific ref of reactor-cpp
uses: actions/checkout@v2
with:
repository: lf-lang/reactor-cpp
path: core/src/main/resources/lib/cpp/reactor-cpp
ref: ${{ inputs.runtime-ref }}
if: ${{ inputs.runtime-ref }}
- name: Run C++ tests;
run: |
./gradlew targetTest -Ptarget=Cpp
- name: Report to CodeCov
uses: ./.github/actions/report-code-coverage
with:
files: core/build/reports/jacoco/integrationTestCodeCoverageReport/integrationTestCodeCoverageReport.xml
if: ${{ github.repository == 'lf-lang/lingua-franca' }}
- name: Collect reactor-cpp coverage data
run: |
lcov --capture --directory test/Cpp --output-file coverage.info
lcov --extract coverage.info ${GITHUB_WORKSPACE}/test/Cpp/src-gen/reactor-cpp-default/\* --output-file reactor-cpp.info
genhtml reactor-cpp.info --output-directory reactor-cpp.coverage
if: matrix.platform == 'ubuntu-latest'
- name: Upload coverage report
uses: actions/upload-artifact@v3
with:
name: reactor-cpp.coverage
path: reactor-cpp.coverage
if: matrix.platform == 'ubuntu-latest'
- name: Report to CodeCov
uses: ./.github/actions/report-code-coverage
with:
files: reactor-cpp.info
if: ${{ github.repository == 'lf-lang/lingua-franca' && matrix.platform == 'ubuntu-latest' }}