This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (55 loc) · 1.76 KB
/
build.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
name: build
on: push
jobs:
set_status_in_progress:
name: set_status_in_progress
if: always()
uses: dpc-sdp/github-actions/.github/workflows/set_status.yml@main
secrets: inherit
with:
context: 'tide_build'
description: 'Tide Build running...'
state: 'pending'
target_url: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
tide_build:
name: tide_build
secrets: inherit
uses: dpc-sdp/github-actions/.github/workflows/tide_build.yml@main
with:
module_build: true
runner: biggy-tide
phpunit_coverage:
name: phpunit_coverage
needs: tide_build
runs-on: biggy-tide
steps:
- name: Run PHPUnit with coverage using phpdbg
run: |
phpdbg -qrr vendor/bin/phpunit ./dpc-sdp --coverage-html ./coverage-report
- name: Check coverage
run: |
coverage=$(grep -Po '(?<=<td class="text-right">)[0-9.]+(?=%</td>)' ./coverage-report/index.html | head -n 1)
if (( $(echo "$coverage < 80" | bc -l) )); then
echo "Code coverage is below 80%: $coverage%"
exit 1
fi
shell: bash
- name: Archive code coverage results
uses: actions/upload-artifact@v2
with:
name: code-coverage-report
path: coverage-report
export_config:
name: export_config
secrets: inherit
uses: dpc-sdp/github-actions/.github/workflows/export_config.yml@main
set_status:
name: set_status
needs: [tide_build]
if: always()
uses: dpc-sdp/github-actions/.github/workflows/set_status.yml@main
secrets: inherit
with:
context: 'tide_build'
description: 'Tide Build'
target_url: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}