-
Notifications
You must be signed in to change notification settings - Fork 32
53 lines (44 loc) · 1.47 KB
/
Copy pathon_pr.yml
File metadata and controls
53 lines (44 loc) · 1.47 KB
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
name: on PR
# Controls when the workflow will run
on:
pull_request:
types: [opened, synchronize, reopened]
concurrency:
group: ci-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}
cancel-in-progress: true
jobs:
main_workflow:
name: CI
uses: ./.github/workflows/main_workflow.yml
with:
run_build_push_docker: true
light_ci: ${{ contains(github.event.pull_request.labels.*.name, 'light-ci') }}
light_ci:
name: Notify Light CI
if: ${{ contains(github.event.pull_request.labels.*.name, 'light-ci') }}
runs-on: ubuntu-latest
steps:
- name: Echo message
run: |
cat >> report_______light_ci.md <<'EOF'
Light CI is enabled. This will only run the basic tests and not the full tests.
Merging a PR require the job "on PR / all" to pass which is disabled in this case.
EOF
- uses: actions/upload-artifact@v4
with:
name: report_light_ci
path: ./report_______light_ci.md
all:
needs: [ main_workflow ]
# run always except for cancel
if: ${{ always() && !cancelled() && !contains(github.event.pull_request.labels.*.name, 'light-ci') }}
runs-on: ubuntu-latest
steps:
- name: Status summary
run: |
if [ "${{ needs.main_workflow.result }}" == "failure" ] || [ "${{ needs.main_workflow.result }}" == "canceled" ]; then
echo "Tests failed."
exit 1
else
exit 0
fi