-
Notifications
You must be signed in to change notification settings - Fork 11
140 lines (116 loc) · 4.79 KB
/
server_component_test.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
#
# If not stated otherwise in this file or this component's LICENSE file the
# following copyright and licenses apply:
#
# Copyright 2023 Sky UK
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# This workflow builds and runs the rialto server component tests. The workflow shall fail if any test fails
# and the results of the tests are checked and displayed in github. Coverage of the api interfaces are also
# checked, the workflow shall fail if these are not 100% covered. Logs are uploaded on failure.
name: server_component_tests
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master", "rdkcentral:master" ]
pull_request:
branches: [ "master", "rdkcentral:master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This job sets up the repo with the dependancies then runs the server component tests
run-server-test:
name: Build and test server component tests
# Runs on ubuntu
runs-on: ubuntu-22.04
# Timeout after
timeout-minutes: 15
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout repo
uses: actions/checkout@v4
# Initialises the host ready to run component tests
- name: Initialise host
uses: ./.github/workflows/actions/init_ut
# Run the build script for server
- name: build_ct.py script server
run: |
python build_ct.py -c -xml -f -cov -s server
# Processes the results of the component test and the lcov output
- name: Process output
uses: ./.github/workflows/actions/process_results_ut
if: success() || failure()
with:
suite: 'server'
# Upload logs on failure
- name: Upload logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: logs
path: |
gtest_result.log
build/*gtest_result.xml
# Cache lcov output
- name: Cache server component tests interface stats
id: cache-server-component-coverage-stats
uses: actions/cache@v4
if: success()
with:
path: build/coverage_statistics_public_apis.txt
key: ${{ runner.os }}-server-component-coverage-stats-${{ github.run_id }}-${{ github.run_number }}
# Upload coverage report on success
- name: Upload Coverage Report
uses: actions/upload-artifact@v4
if: success()
with:
name: coverage_report_component
path: build/gh_pages/coverage_report
# Upload coverage statistics on success
- name: Upload Coverage Statistics
uses: actions/upload-artifact@v4
if: success()
with:
name: coverage_report_stats_component
path: build/coverage_statistics.txt
# This job checks the api coverage
# Will only check stats on pull request
check-interface-api-coverage:
name: Checks the coverage statistics of the api interface
# Runs on ubuntu
runs-on: ubuntu-22.04
# Timeout after
timeout-minutes: 10
needs: [run-server-test]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout repo
if: ${{ github.ref != 'refs/heads/master' }}
uses: actions/checkout@v4
# Get cached lcov server component tests interface api stats
- name: Get server component tests interface api stats
id: cache-server-component-coverage-stats
uses: actions/cache@v4
if: ${{ github.ref != 'refs/heads/master' }}
with:
path: build/coverage_statistics_public_apis.txt
key: ${{ runner.os }}-server-component-coverage-stats-${{ github.run_id }}-${{ github.run_number }}
# Run the check_coverage_stats script
- name: Process Coverage Statistics
if: ${{ success() && github.ref != 'refs/heads/master' }}
run: python scripts/coverage/check_coverage_stats.py build/coverage_statistics_public_apis.txt 8