-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (49 loc) · 1.32 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
name: Coverage
on:
schedule:
- cron: '5 4 3 * *'
push:
branches:
- main
paths:
- '.shellspec'
- 'src/*.sh'
- 'tests/*.sh'
workflow_dispatch:
jobs:
coverage:
name: Run tests coverage
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.7.1
- name: Install shellspec
run: |
mkdir -p ~/shellspec
cd ~/shellspec
git clone https://github.com/shellspec/shellspec.git
ln -s ~/shellspec/shellspec/shellspec /usr/local/bin/shellspec
echo -n "shellspec version: "
shellspec --version
- name: Install kcov
run: |
sudo apt install -y kcov
echo -n "kcov version: "
kcov --version
- name: Checkout Code
uses: actions/checkout@v4
- name: Generate tests coverage reports
run: |
bash shellspec --kcov --jobs 50
- name: Upload reports
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage
- name: Upload coverage reports to Codecov
if: ${{ github.ref == 'refs/heads/main' }}
uses: codecov/codecov-action@v5
with:
directory: coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}