-
-
Notifications
You must be signed in to change notification settings - Fork 23
167 lines (166 loc) · 5.12 KB
/
end-to-end-tests.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# This file was generated using Kotlin DSL (.github/workflows/end-to-end-tests.main.kts).
# If you want to modify the workflow, please change the Kotlin file and regenerate this YAML file.
# Generated with https://github.com/typesafegithub/github-workflows-kt
name: 'End-to-end tests'
on:
push:
branches:
- 'main'
pull_request: {}
jobs:
check_yaml_consistency:
name: 'Check YAML consistency'
runs-on: 'ubuntu-latest'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
steps:
- id: 'step-0'
name: 'Check out'
uses: 'actions/checkout@v4'
- id: 'step-1'
name: 'Set up JDK'
uses: 'actions/setup-java@v4'
with:
java-version: '11'
distribution: 'zulu'
- id: 'step-2'
uses: 'gradle/actions/setup-gradle@v3'
with:
generate-job-summary: 'false'
- id: 'step-3'
name: 'Publish to Maven local'
run: './gradlew publishToMavenLocal'
- id: 'step-4'
name: 'Execute script'
run: 'rm ''.github/workflows/end-to-end-tests.yaml'' && ''.github/workflows/end-to-end-tests.main.kts'''
- id: 'step-5'
name: 'Consistency check'
run: 'git diff --exit-code ''.github/workflows/end-to-end-tests.yaml'''
test_job_1:
runs-on: 'ubuntu-latest'
permissions:
actions: 'read'
checks: 'write'
contents: 'none'
needs:
- 'check_yaml_consistency'
env:
$GREETING: 'World'
outputs:
scriptKey: '${{ steps.step-20.outputs.key }}'
scriptKey2: '${{ steps.step-20.outputs.key2 }}'
scriptResult: '${{ steps.step-20.outputs.result }}'
steps:
- id: 'step-0'
name: 'Hello world!'
run: 'echo ''hello!'''
- id: 'step-1'
name: 'Hello world! Multiline command with pipes'
run: |-
less test.txt \
| grep -P "foobar" \
| sort \
> result.txt
- id: 'step-2'
name: 'Check out'
uses: 'actions/checkout@v4'
- id: 'step-3'
name: 'Run local action'
uses: './.github/workflows/test-local-action'
with:
name: 'Rocky'
- id: 'step-4'
name: 'Run alpine'
uses: 'docker://alpine:latest'
- id: 'step-5'
name: 'Check out again'
uses: 'actions/checkout@v4'
with:
repository: 'actions/checkout'
ref: 'v3'
path: './.github/actions/checkout'
clean: 'false'
- id: 'step-6'
name: 'Run local action'
uses: './.github/workflows/test-local-action'
with:
name: 'Balboa'
- id: 'step-7'
name: 'Run alpine'
uses: 'docker://alpine:latest'
- id: 'step-8'
uses: 'actions/setup-python@v5'
- id: 'step-9'
name: 'Some step consuming other step''s output'
uses: 'actions/checkout@v4'
with:
ssh-key: '${{ steps.step-8.outputs.python-version }}'
path: '${{ steps.step-8.outputs.my-unsafe-output }}'
- id: 'step-10'
name: 'Custom environment variable'
env:
$FIRST_NAME: 'Patrick'
run: 'echo $GREETING $FIRST_NAME'
- id: 'step-11'
name: 'Encrypted secret'
env:
$SECRET: '${{ secrets.SUPER_SECRET }}'
$TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: 'echo secret=$SECRET token=$TOKEN'
- id: 'step-12'
name: 'RunnerContext create temp directory'
run: 'mkdir ${{ runner.temp }}/build_logs'
- id: 'step-13'
name: 'GitHubContext echo sha'
run: 'echo ${{ github.sha }} ev ${{ github.event.release.url }}'
- id: 'step-14'
name: 'Default environment variable'
run: 'action=$GITHUB_ACTION repo=$GITHUB_REPOSITORY'
if: '${{ always() }}'
- id: 'step-15'
name: 'Set up JDK'
uses: 'actions/setup-java@v4'
with:
java-version: '11'
distribution: 'zulu'
- id: 'step-16'
uses: 'gradle/actions/setup-gradle@v3'
with:
generate-job-summary: 'false'
- id: 'step-17'
name: 'Publish to Maven local'
run: './gradlew publishToMavenLocal'
- id: 'step-18'
name: 'Evaluating condition for ''Step with a Kotlin-based logic'''
env:
GHWKT_GITHUB_CONTEXT_JSON: '${{ toJSON(github) }}'
run: 'GHWKT_RUN_STEP=''test_job_1:step-18'' ''.github/workflows/end-to-end-tests.main.kts'''
- id: 'step-19'
name: 'Step with a Kotlin-based logic'
env:
GHWKT_GITHUB_CONTEXT_JSON: '${{ toJSON(github) }}'
run: 'GHWKT_RUN_STEP=''test_job_1:step-19'' ''.github/workflows/end-to-end-tests.main.kts'''
if: '${{ steps.step-18.outputs.evaluation-result }}'
- id: 'step-20'
uses: 'actions/github-script@v7'
with:
script: |-
core.setOutput("key", "value")
core.setOutput("key2", "value2")
return "return"
test_job_2:
runs-on: 'ubuntu-latest'
needs:
- 'test_job_1'
- 'check_yaml_consistency'
if: '${{ always() }}'
steps:
- id: 'step-0'
name: 'Hello world, again!'
run: 'echo ''hello again!'''
- id: 'step-1'
name: 'use output of script'
run: |-
echo ${{ needs.test_job_1.outputs.scriptKey }}
echo ${{ needs.test_job_1.outputs.scriptKey2 }}
echo ${{ needs.test_job_1.outputs.scriptResult }}