1+ name : CI
2+
3+ on :
4+ milestone :
5+ types : [opened]
6+ workflow_dispatch :
7+ inputs :
8+ firstShouldFail :
9+ type : boolean
10+ default : false
11+ secondShouldFailBefore :
12+ type : boolean
13+ default : false
14+ secondShouldFailAfter :
15+ type : boolean
16+ default : false
17+ jobs :
18+
19+ setup :
20+ name : " Zero"
21+ runs-on : ubuntu-22.04
22+
23+ steps :
24+ - run : echo "tamaman"
25+
26+
27+ validate-submission :
28+ name : " First"
29+ runs-on : ubuntu-22.04
30+ needs : [setup]
31+
32+ steps :
33+ - run : echo "Ah que coucou"
34+
35+ - run : if ${{ inputs.firstShouldFail }}; then exit 1; fi
36+
37+
38+ chart-verifier :
39+ name : " Second"
40+ runs-on : ubuntu-22.04
41+ needs : [setup, validate-submission]
42+
43+ outputs :
44+ chart-verifier-outcome : ${{ steps.chart-verifier-step.conclusion }}
45+ chart-verifier-step : ${{ steps.chart-verifier-step.outputs.chart-verifier-step }}
46+
47+ steps :
48+ - run : if ${{ inputs.secondShouldFailBefore }}; then exit 1; fi
49+ - id : chart-verifier-step
50+ run : echo "chart-verifier-step=Tu-veux-voir" | tee -a $GITHUB_OUTPUT
51+
52+ - run : if ${{ inputs.secondShouldFailAfter }}; then exit 1; fi
53+
54+ manage-pr :
55+ name : " Third"
56+ runs-on : ubuntu-22.04
57+ needs : [setup, chart-verifier, validate-submission]
58+
59+ # Run manage-pr as long as setup was successfull, independently from potential errors in validate-submission or chart-verifier
60+ if : ${{ always() && needs.setup.result == 'success' }}
61+
62+ steps :
63+ - run : echo "MA BITE !"
64+
65+ # - name: "Sanitize output in case chart-verifier job did not run"
66+ # run: |
67+ # if "${{ needs.chart-verifier.result }}" == ""; then
68+ # echo "chart-verifier-outcome=skipped" | tee -a $GITHUB_OUTPUT
69+
70+ - run : |
71+ echo "chart verifier job result: " ${{ needs.chart-verifier.result || 'custom skip1' }}
72+ echo "chart verifier step outcome: " ${{ needs.chart-verifier.outputs.chart-verifier-outcome || 'custom skip2' }}
73+ echo "Value from chart verifier step: " ${{ needs.chart-verifier.outputs.chart-verifier-step || 'custom skip3' }}
74+ # env:
75+ # three: ${{ needs.chart-verifier.outputs.chart-verifier-step || 'custom skip3' }}
76+ # one: ${{ needs.chart-verifier.result || 'custom skip' }}
77+ # two: ${{ needs.chart-verifier.result == "toto" && "custom skip" || "tata" }}
78+
79+ # steps:
80+ # - run: python3 --version
81+
82+ # - run: pip install environs
83+
84+ # - id: my_output
85+ # run: |
86+ # cat << EOF > script1.py
87+ # import os
88+
89+ # def add_output(name, value):
90+ # with open(os.environ["GITHUB_OUTPUT"], "a") as fh:
91+ # print(f"Adding to GITHUB_OUTPUT: {name}={value}")
92+ # print(f"{name}={value}", file=fh)
93+
94+ # # add_output("web_catalog_only", True)
95+ # EOF
96+
97+ # python3 script1.py
98+
99+ # - env:
100+ # WEB_CATALOG_ONLY: ${{ steps.my_output.outputs.web_catalog_only }}
101+ # run: |
102+ # echo $WEB_CATALOG_ONLY
103+
104+ # cat << EOF > script2.py
105+ # from environs import Env
106+ # env = Env()
107+ # web_catalog_only = env.bool("WEB_CATALOG_ONLY", False)
108+ # print("type is: " + str(type(web_catalog_only)))
109+ # print("value is: " + str(web_catalog_only))
110+ # EOF
111+
112+ # python3 script2.py
0 commit comments