forked from tarantool/tarantool
-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (122 loc) · 4.64 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
name: coverage
on:
push:
branches:
- 'master'
- 'release/**'
tags:
- '**'
pull_request:
workflow_dispatch:
workflow_call:
inputs:
submodule:
description: Name of submodule to bump.
required: true
type: string
revision:
description: Git revision from submodule repository
required: true
type: string
concurrency:
# Update of a developer branch cancels the previously scheduled workflow
# run for this branch. However, the 'master' branch, release branch, and
# tag workflow runs are never canceled.
#
# We use a trick here: define the concurrency group as 'workflow run ID' +
# 'workflow run attempt' because it is a unique combination for any run.
# So it effectively discards grouping.
#
# Important: we cannot use `github.sha` as a unique identifier because
# pushing a tag may cancel a run that works on a branch push event.
group: ${{ (
github.ref == 'refs/heads/master' ||
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.ref, 'refs/tags/')) &&
format('{0}-{1}', github.run_id, github.run_attempt) ||
format('{0}-{1}-coverage', github.workflow, github.ref) }}
cancel-in-progress: true
jobs:
coverage:
# Run on push to the 'master' and release branches of tarantool/tarantool
# or on pull request if the 'notest' label is not set.
if: github.repository_owner == 'tarantool' &&
( github.event_name != 'pull_request' ||
( github.event_name == 'pull_request' &&
!contains(github.event.pull_request.labels.*.name, 'notest') ) )
runs-on: ubuntu-20.04-self-hosted
timeout-minutes: 60
container:
image: docker.io/tarantool/testing:ubuntu-focal
# Mount /dev to the container to be able to mount a disk image inside it
# for successful run of the .github/actions/environment action.
volumes:
- /dev:/dev
# Our testing expects that the init process (PID 1) will
# reap orphan processes. At least the following test leans
# on it: app-tap/gh-4983-tnt-e-assert-false-hangs.test.lua.
# Add extra privileges to the container for successful run
# of the .github/actions/environment action.
options: '--init --privileged'
steps:
- name: Prepare checkout
uses: tarantool/actions/prepare-checkout@master
- name: Sources checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
repository: tarantool/tarantool
ref: ${{ inputs.submodule && 'master' || github.ref }}
- name: Set environment
uses: ./.github/actions/environment
- name: Install deps
uses: ./.github/actions/install-deps-debian
- name: Optional submodule bump
if: ${{ inputs.submodule }}
uses: ./.github/actions/bump-submodule
with:
submodule: ${{ inputs.submodule }}
revision: ${{ inputs.revision }}
- name: Run testing with coverage enabled
run: make -f .test.mk test-coverage
- name: Upload coverage results to coveralls.io
# Avoid interference with the coverage of a submodule.
if: ${{ !inputs.submodule }}
run: |
coveralls-lcov \
--service-name=github \
--repo-token=${{ secrets.GITHUB_TOKEN }} \
--service-job-id=${{ github.run_id }} \
--branch=${{ github.ref }} \
${{ github.event_name == 'pull_request' &&
format('--service-pull-request={0}', github.event.number) || '' }} \
./coverage.info
- name: Send VK Teams message on failure
if: failure()
uses: ./.github/actions/report-job-status
with:
bot-token: ${{ secrets.VKTEAMS_BOT_TOKEN }}
- name: Collect coverage info
uses: actions/upload-artifact@v4
with:
name: coverage
retention-days: 21
path: ./coverage.info
- name: Collect failure logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: failure-logs
retention-days: 21
path: ${{ env.VARDIR }}/artifacts
- name: Upload logs to S3
uses: ./.github/actions/s3-upload-artifact
if: ( success() || failure() ) && ( github.ref == 'refs/heads/master' ||
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.ref, 'refs/tags/') )
with:
job-name: ${{ github.job }}
access-key-id: ${{ secrets.MULTIVAC_S3_ACCESS_KEY_ID }}
secret-access-key: ${{ secrets.MULTIVAC_S3_SECRET_ACCESS_KEY }}
source: ${{ env.VARDIR }}/artifacts