-
Notifications
You must be signed in to change notification settings - Fork 3
69 lines (69 loc) · 2.01 KB
/
coverage.yaml
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
name: Coverage
permissions:
contents: write
pull-requests: write
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
Linux:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['8.3']
type: ['cli', 'zts']
distro: ['bookworm']
outputs:
matrix: ${{ toJson(matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Setup buildx
uses: docker/setup-buildx-action@v3
- name: Build container
run: |
docker compose build --pull --no-cache --build-arg PLATFORM="linux/amd64" --build-arg IMAGE="php" --build-arg TAG="${{ matrix.version }}-${{ matrix.type }}-${{ matrix.distro }}"
- name: Test with gcov
run: |
docker compose run -v "$(pwd)/ext:/ext" --rm shell pskel coverage
- name: Upload coverage to artifact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ matrix.version }}-${{ matrix.type }}-${{ matrix.distro }}
path: ${{ github.workspace }}/ext/lcov.info
Coverage:
needs: [Linux]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download coverage artifacts
uses: actions/download-artifact@v4
- name: Merge and filter coverages
run: |
sudo apt-get install -y "lcov"
LCOV_FILES="$(find . -name "lcov.info")"
CMD="$(which "lcov")"
for LCOV_FILE in ${LCOV_FILES}; do
CMD+=" -a ${LCOV_FILE}"
done
CMD+=" -o lcov.info"
echo "Merging coverages: ${LCOV_FILES}"
${CMD}
lcov --remove "lcov.info" "*/third_party/*" -o "lcov.info"
- name: List coverage
run: |
lcov --list "lcov.info"
- name: Report coverage
uses: k1LoW/octocov-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
config: .github/octocov.yml