6
6
# For more info visit https://github.com/pulp/plugin_template
7
7
8
8
---
9
- name : Python CI
9
+ name : " Python CI"
10
10
on : {pull_request: {branches: ['*']}}
11
11
12
12
concurrency :
@@ -18,59 +18,76 @@ defaults:
18
18
working-directory : " pulp_python"
19
19
20
20
jobs :
21
-
22
- ready-to-ship :
23
- runs-on : ubuntu-latest
21
+ check-commits :
22
+ runs-on : " ubuntu-latest"
24
23
steps :
25
- - uses : actions/checkout@v4
24
+ - uses : " actions/checkout@v4"
26
25
with :
27
26
fetch-depth : 0
28
27
path : " pulp_python"
29
- - uses : actions/setup-python@v4
28
+ - uses : " actions/setup-python@v4"
30
29
with :
31
30
python-version : " 3.8"
32
- - name : Install requirements
33
- run : pip3 install github
34
- - name : Check commit message
31
+ - name : " Install python dependencies"
32
+ run : |
33
+ echo ::group::PYDEPS
34
+ pip install requests pygithub
35
+ echo ::endgroup::
36
+ - name : " Check commit message"
35
37
if : github.event_name == 'pull_request'
36
38
env :
37
- PY_COLORS : ' 1'
38
- ANSIBLE_FORCE_COLOR : ' 1'
39
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
40
- GITHUB_CONTEXT : ${{ github.event.pull_request.commits_url }}
41
- run : sh .github/workflows/scripts/check_commit.sh
42
- - name : Verify requirements files
43
- run : python .ci/scripts/check_requirements.py
39
+ PY_COLORS : " 1"
40
+ ANSIBLE_FORCE_COLOR : " 1"
41
+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
42
+ GITHUB_CONTEXT : " ${{ github.event.pull_request.commits_url }}"
43
+ run : |
44
+ .github/workflows/scripts/check_commit.sh
45
+ - name : " Verify requirements files"
46
+ run : |
47
+ python .ci/scripts/check_requirements.py
44
48
45
49
lint :
46
50
uses : " ./.github/workflows/lint.yml"
47
51
48
52
build :
49
- needs : lint
53
+ needs : " lint"
50
54
uses : " ./.github/workflows/build.yml"
51
55
52
56
test :
53
- needs : build
57
+ needs : " build"
54
58
uses : " ./.github/workflows/test.yml"
55
59
56
60
deprecations :
57
- defaults :
58
- run :
59
- working-directory : " ."
60
- runs-on : ubuntu-latest
61
+ runs-on : " ubuntu-latest"
61
62
if : github.base_ref == 'main'
62
- needs : test
63
+ needs : " test"
63
64
steps :
64
- - name : Fail on deprecations
65
+ - name : " Create working directory"
66
+ run : |
67
+ mkdir -p "pulp_python"
68
+ working-directory : " ."
69
+ - name : " Download Deprecations"
70
+ uses : actions/download-artifact@v3
71
+ with :
72
+ name : " deprecations"
73
+ path : " pulp_python"
74
+ - name : " Print deprecations"
65
75
run : |
66
- test -z "${{ needs.test.outputs.deprecations-pulp }}"
67
- test -z "${{ needs.test.outputs.deprecations-azure }}"
68
- test -z "${{ needs.test.outputs.deprecations-s3 }}"
69
- test -z "${{ needs.test.outputs.deprecations-lowerbounds }}"
70
- - name : Print deprecations
71
- if : failure()
76
+ cat deprecations-*.txt | sort -u
77
+ ! cat deprecations-*.txt | grep '[^[:space:]]'
78
+
79
+ ready-to-ship :
80
+ # This is a dummy dependent task to have a single entry for the branch protection rules.
81
+ runs-on : " ubuntu-latest"
82
+ needs :
83
+ - " check-commits"
84
+ - " lint"
85
+ - " test"
86
+ if : " always()"
87
+ steps :
88
+ - name : " Collect needed jobs results"
89
+ working-directory : " ."
72
90
run : |
73
- echo "${{ needs.test.outputs.deprecations-pulp }}" | base64 -d
74
- echo "${{ needs.test.outputs.deprecations-azure }}" | base64 -d
75
- echo "${{ needs.test.outputs.deprecations-s3 }}" | base64 -d
76
- echo "${{ needs.test.outputs.deprecations-lowerbounds }}" | base64 -d
91
+ echo '${{toJson(needs)}}' | jq -r 'to_entries[]|select(.value.result!="success")|.key + ": " + .value.result'
92
+ echo '${{toJson(needs)}}' | jq -e 'to_entries|map(select(.value.result!="success"))|length == 0'
93
+ echo "CI says: Looks good!"
0 commit comments