-
-
Notifications
You must be signed in to change notification settings - Fork 7
131 lines (129 loc) · 4.64 KB
/
coverage.yml
File metadata and controls
131 lines (129 loc) · 4.64 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
---
# SPDX-FileCopyrightText: NONE
# SPDX-License-Identifier: CC0-1.0
name: "Coverage"
permissions: {}
on:
push:
paths-ignore:
- ".github/**"
- ".gitlab/**"
- ".gitlab-ci.yml"
- ".travis.yml"
branches:
- "**"
tags:
- "v*.*"
pull_request:
jobs:
coverage:
name: "Coverage"
runs-on: ubuntu-latest
timeout-minutes: 20
concurrency:
group: "${{ github.repository_id }}-${{ github.workflow }}-coverage"
cancel-in-progress: false
permissions:
contents: read # Needed to checkout the repository (only required for private repositories)
steps:
- name: "Checkout sources"
uses: actions/checkout@v6
with:
lfs: false
- name: "Setup Java"
uses: actions/setup-java@v5
with:
distribution: "temurin"
java-version-file: ".tool-versions"
- name: "Setup Ruby"
uses: ruby/setup-ruby@v1
timeout-minutes: 10
with:
ruby-version: "3.4"
bundler-cache: "true"
- name: "Install Bashcov and simplecov-lcov"
shell: bash
timeout-minutes: 10
run: |
# Installing Bashcov and simplecov-lcov...
gem install bashcov:3.3.0 simplecov-lcov
- name: "Use build cache"
uses: actions/cache/restore@v5
timeout-minutes: 5
with:
key: "build-${{ hashFiles('conf-2.sh') }}"
restore-keys: "build-"
path: "cache/build"
enableCrossOsArchive: true
- name: "Use LFS cache"
uses: actions/cache/restore@v5
timeout-minutes: 5
with:
key: "lfs-${{ hashFiles('conf-lfs.sh') }}"
restore-keys: "lfs-"
path: "cache/lfs"
enableCrossOsArchive: true
- name: "Build (with coverage)"
id: "build"
shell: bash
timeout-minutes: 10
run: |
# Executing code coverage...
export BUILD_TYPE=oss
#sudo apt-get -qq -y install moreutils 1>/dev/null
bashcov '${{ github.workspace }}/build.sh' # To timestamp the output pipe it to: TZ=UTC ts '[%H:%M:%S]'
- name: "Testing (with coverage)"
shell: bash
timeout-minutes: 10
if: "${{ steps.build.outputs.ZIP_BUILD_TYPE_SUPPORTED == 'true' }}"
run: |
# Testing of zip installation...
echo '==========================='
echo 'TESTING OF ZIP INSTALLATION'
echo '==========================='
bashcov '${{ github.workspace }}/recovery-simulator/recovery.sh' '${{ steps.build.outputs.ZIP_FOLDER }}/${{ steps.build.outputs.ZIP_FILENAME }}'
printf '\n'
echo '==============='
echo 'RECOVERY OUTPUT'
echo '==============='
if test -e '${{ github.workspace }}/recovery-simulator/output/recovery-output.log'; then
cat '${{ github.workspace }}/recovery-simulator/output/recovery-output.log'
fi
printf '\n'
echo '==============='
echo 'INSTALLED FILES'
echo '==============='
if test -e '${{ github.workspace }}/recovery-simulator/output/installed-files.log'; then
cat '${{ github.workspace }}/recovery-simulator/output/installed-files.log'
fi
- name: "Verify Codecov token"
id: "codecov-token"
shell: bash
env:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
run: |
# Verifying token...
if test -n "${CODECOV_TOKEN?}"; then token_set='true'; else token_set='false'; fi
printf 'TOKEN_SET=%s\n' "${token_set:?}" 1>> "${GITHUB_OUTPUT?}"
- name: "Upload coverage reports to Codecov"
if: "${{ steps.codecov-token.outputs.TOKEN_SET == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}"
uses: codecov/codecov-action@v6
timeout-minutes: 10
with:
fail_ci_if_error: true
token: "${{ secrets.CODECOV_TOKEN }}"
- name: "Verify Codacy token"
id: "codacy-token"
shell: bash
env:
CODACY_TOKEN: "${{ secrets.CODACY_PROJECT_TOKEN }}"
run: |
# Verifying token...
if test -n "${CODACY_TOKEN?}"; then token_set='true'; else token_set='false'; fi
printf 'TOKEN_SET=%s\n' "${token_set:?}" 1>> "${GITHUB_OUTPUT?}"
- name: "Upload coverage reports to Codacy"
if: "${{ steps.codacy-token.outputs.TOKEN_SET == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main' }}"
uses: codacy/codacy-coverage-reporter-action@v1
timeout-minutes: 10
with:
project-token: "${{ secrets.CODACY_PROJECT_TOKEN }}"