Skip to content

Commit 77b5bb5

Browse files
committed
ci: add separate coverage job
Running tests, collecting the coverage and sending it to the coveralls was in a single job. After the patch tests, whether ran with and without coverage, were separated. Closes #22
1 parent bc96eec commit 77b5bb5

File tree

1 file changed

+48
-4
lines changed

1 file changed

+48
-4
lines changed

.github/workflows/testing.yaml

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
linux:
9+
tests:
1010
# We want to run on external PRs, but not on our own internal
1111
# PRs as they'll be run by the push to the branch.
1212
#
@@ -21,7 +21,6 @@ jobs:
2121
- 'debug-master'
2222
include:
2323
- tarantool: '3.1'
24-
coveralls: true
2524
env:
2625
TNT_DEBUG_PATH: /home/runner/tnt-debug
2726

@@ -49,15 +48,60 @@ jobs:
4948
key: "cache-rocks-${{ matrix.tarantool }}${{ env.VERSION_POSTFIX }}"
5049

5150
- name: Install requirements
52-
run: make deps depname=coverage
51+
run: make deps depname=test
5352
if: steps.cache-rocks.outputs.cache-hit != 'true'
5453

5554
- run: echo $PWD/.rocks/bin >> $GITHUB_PATH
5655

5756
- run: make test
5857

58+
coverage:
59+
# We want to run on external PRs, but not on our own internal
60+
# PRs as they'll be run by the push to the branch.
61+
#
62+
# The main trick is described here:
63+
# https://github.com/Dart-Code/Dart-Code/pull/2375
64+
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
65+
66+
strategy:
67+
fail-fast: false
68+
69+
env:
70+
TNT_DEBUG_PATH: /home/runner/tnt-debug
71+
72+
runs-on: ubuntu-22.04
73+
steps:
74+
- name: Clone the module
75+
uses: actions/checkout@v3
76+
77+
- name: Setup tt
78+
run: |
79+
curl -L https://tarantool.io/release/3/installer.sh | bash
80+
sudo apt install -y tt
81+
tt version
82+
83+
- name: Install Tarantool
84+
uses: ./.github/actions/install-tarantool
85+
with:
86+
tarantool: '3.1'
87+
88+
- name: Cache rocks
89+
uses: actions/cache@v3
90+
id: cache-rocks
91+
with:
92+
path: .rocks/
93+
key: "cache-rocks-3.1${{ env.VERSION_POSTFIX }}"
94+
95+
- name: Install requirements
96+
run: make deps depname=coverage
97+
if: steps.cache-rocks.outputs.cache-hit != 'true'
98+
99+
- run: echo $PWD/.rocks/bin >> $GITHUB_PATH
100+
101+
- name: Run tests with coverage
102+
run: make test-coverage
103+
59104
- name: Send code coverage to 'coveralls.io'
60105
run: make coveralls
61-
if: ${{ matrix.coveralls }}
62106
env:
63107
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)