-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (64 loc) · 2.01 KB
/
ci.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
name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main]
jobs:
test:
strategy:
fail-fast: false
matrix:
bash: [ "5.1", "5.2" ]
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
submodules: recursive
- name: "Test bash-${{ matrix.bash }}"
run: TEST_BASH_VERSION=${{ matrix.bash }} test/run --docker
coverage:
needs: test
runs-on: ubuntu-latest
container: kcov/kcov
steps:
- name: "Install git"
run: apt-get update && apt-get install -y --fix-missing git
- name: "Checkout"
uses: actions/checkout@v4
with:
submodules: recursive
- name: "Install dependencies"
run: apt-get update && apt-get install -y --fix-missing $(cat DEPENDENCIES.md)
- name: "Coverage"
run: |
kcov --include-path=src --exclude-line='done <,for' /__w/bee/bee/coverage test/bats/bin/bats test
find coverage -type f -name "*.*" -exec sed -i 's/\/__w\/bee\/bee\///g' {} \;
- name: "Upload coverage report"
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }} Coverage Report
path: coverage
coveralls:
needs: coverage
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v4
with:
submodules: recursive
- name: "Download coverage report"
uses: actions/download-artifact@v4
with:
name: ${{ github.event.repository.name }} Coverage Report
path: coverage
- name: "Generate lcov"
run: |
dotnet tool install -g dotnet-reportgenerator-globaltool
reportgenerator -reports:"coverage/**/cobertura.xml" -targetdir:"coverage" -reporttypes:"lcov"
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: "coverage/lcov.info"