-
Notifications
You must be signed in to change notification settings - Fork 43
48 lines (43 loc) · 1.66 KB
/
python-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
name: python-coverage
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
op-unit-test:
concurrency:
group: op-unit-test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
uses: ./.github/workflows/op-unit-test.yaml
model-test:
concurrency:
group: model-test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
uses: ./.github/workflows/model-test.yaml
coverage-test:
concurrency:
group: coverage-test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
runs-on: [self-hosted, docker]
needs: [op-unit-test, model-test]
container:
image: localhost:5000/flag-gems-ci:v1.0
ports:
- 81
options: --gpus all --hostname flag-gems_cicd_coverage -v /home/flaggems_cicd/PR_Coverage:/PR_Coverage
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get python coverage
shell: bash
run: |
git config --global --add safe.directory /__w/FlagGems/FlagGems
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "This is a pull request event. PR number is ${{ github.event.pull_request.number }}"
bash tools/code_coverage/coverage.sh ${{ github.event.pull_request.number }}
elif [ "${{ github.event_name }}" == "push" ]; then
PR_NUMBER=$(git log -1 --pretty=format:'%s' | grep -oE '#[0-9]+' | grep -oE '[0-9]+')
echo "This is a push event. The relate PR number is ${PR_NUMBER}"
bash tools/code_coverage/coverage.sh ${PR_NUMBER}
fi