You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/docs/README.md
+43-28Lines changed: 43 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# Building Strimzi
1
+
# Build & Test Strimzi in GitHub Actions
2
2
The following lines put together basic information how is Strimzi built and tested via GitHub Actions.
3
3
Currently, our main build system still lives on Azure Pipelines and running builds and tests on GHA is in experimental phase.
4
4
All the steps mentioned bellow re-use scripts from our [azure](../../.azure) directory and thus all the steps are more or less the same on both systems.
With GitHub Actions we are now able to propagate a specific parameters to our e2e jobs which allow us to just run a subset of tests for example or run it against different kubernetes version etc.
91
+
With GitHub Actions we are now able to propagate a specific parameters to our e2e jobs.
92
+
That allow us to run a subset of tests for example or run it against different kubernetes version etc.
91
93
92
94
### Triggers
93
95
There are two options how the workflows could be triggered - manually via GitHub UI, via issue comment.
@@ -97,44 +99,57 @@ Comment for triggering the workflow has to starts with string `/gha run` and the
97
99
The whole script that parse the trigger even is part of [parse-comment](../actions/systemtests/parse-comment) action.
98
100
Currently, we have these parameters that can be passed through the comment:
| pipeline | Name of the pipeline from [pipelines.yaml](../actions/systemtests/generate-matrix/pipelines.yaml) that wil be executed | regression,upgrade,performance |
103
-
| profile | Testing profile from pom that will be executed | regression,upgrade,performance |
104
-
| agent | Agent that will be used for a specific pipeline (see list of runners in Strimzi org config for more info) | Value set in [pipelines.yaml](../actions/systemtests/generate-matrix/pipelines.yaml) |
105
-
| strimzi_feature_gates | Which Strimzi Feature Gates will be used | Value set in [pipelines.yaml](../actions/systemtests/generate-matrix/pipelines.yaml) |
106
-
| strimzi_rbac_scope | RBAC scope for Strimzi | Value set in [pipelines.yaml](../actions/systemtests/generate-matrix/pipelines.yaml) |
107
-
| cluster_operator_install_type | How Strimzi will be installed during the tests | Value set in [pipelines.yaml](../actions/systemtests/generate-matrix/pipelines.yaml) |
108
-
| parallel | Number of tests that will be executed in parallel | Value set in [pipelines.yaml](../actions/systemtests/generate-matrix/pipelines.yaml) |
109
-
| architecture | Which architecture will be used (should match with agent arch) | Value set in [pipelines.yaml](../actions/systemtests/generate-matrix/pipelines.yaml) |
110
-
| groups | Which Junit5 groups will be executed | all |
111
-
| tests | Which Junit5 tests will be executed | all |
112
-
| kubeVersion | Used Kubernetes version as part of Kind/Minikube setup | The one set as default in setup scripts |
113
-
| kafkaVersion | Which Kafka version will be used in the tests | Default one from STs config |
114
-
115
-
Note that parameters are passed only to a `custom` pipeline except `kafkaVersion` and `kubeVersion` that are used for all jobs.
116
-
117
-
For trigger via GitHub UI you can specify `releaseVersion`, `kafkaVersion`, and `profile`.
118
-
The first two parameters are working in the same manner as in Azure.
119
-
`profile`is used to filter out all pipelines defined in [pipelines.yaml](../actions/systemtests/generate-matrix/pipelines.yaml) that contains one of the profile specified in comma separated list in `profile` parameter.
| pipeline | Name of the pipeline from [pipelines.yaml](../actions/generate-matrix/pipelines.yaml) that wil be executed | regression,upgrade |
105
+
| profile | Testing profile from [pipelines.yaml](../actions/generate-matrix/pipelines.yaml) that will be executed, it has to be defined in pom file | smoke |
106
+
| agent | Agent that will be used for a specific pipeline (see list of runners in Strimzi org config for more info) | Value set in [pipelines.yaml](../actions/generate-matrix/pipelines.yaml) |
107
+
| strimzi_feature_gates | Which Strimzi Feature Gates will be used | Value set in [pipelines.yaml](../actions/generate-matrix/pipelines.yaml) |
108
+
| strimzi_rbac_scope | RBAC scope for Strimzi | Value set in [pipelines.yaml](../actions/generate-matrix/pipelines.yaml) |
109
+
| cluster_operator_install_type | How Strimzi will be installed during the tests | Value set in [pipelines.yaml](../actions/generate-matrix/pipelines.yaml) |
110
+
| parallel | Number of tests that will be executed in parallel | Value set in [pipelines.yaml](../actions/generate-matrix/pipelines.yaml) |
111
+
| architecture | Which architecture will be used (should match with agent arch) | Value set in [pipelines.yaml](../actions/generate-matrix/pipelines.yaml) |
112
+
| groups | Which Junit5 groups will be executed | all |
113
+
| tests | Which Junit5 tests will be executed | all |
114
+
| kubeVersion | Used Kubernetes version as part of Kind/Minikube setup | The one set as default in setup scripts |
115
+
| kafkaVersion | Which Kafka version will be used in the tests | Default one from STs config |
116
+
117
+
The process of parameter usage is as follows:
118
+
- `pipeline`has the highest priority. If `pipeline` is defined, the jobs will be loaded with data from [pipelines.yaml](../actions/generate-matrix/pipelines.yaml) that match specific _pipeline_.
119
+
- `profile`has the second-highest priority. If `profile` is defined, the jobs will be loaded with data from [pipelines.yaml](../actions/generate-matrix/pipelines.yaml) that match specific _profile_.
120
+
- `agent`is used only for a `custom` pipeline when either `pipeline` or `profile` are not specified via comment.
121
+
- `strimzi_feature_gates`is used only for a `custom` pipeline when either `pipeline` or `profile` are not specified via comment.
122
+
- `strimzi_rbac_scope`is used only for a `custom` pipeline when either `pipeline` or `profile` are not specified via comment.
123
+
- `cluster_operator_install_type`is used only for a `custom` pipeline when either `pipeline` or `profile` are not specified via comment.
124
+
- `parallel`is used only for a `custom` pipeline when either `pipeline` or `profile` are not specified via comment.
125
+
- `architecture`is used only for a `custom` pipeline when either `pipeline` or `profile` are not specified via comment.
126
+
- `groups`are passed directly to `mvn` command. It should be used mostly only with `custom` pipeline as otherwise a specific `pipeline` could have the `groups` excluded.
127
+
- `tests`are passed directly to `mvn` command. It should be used mostly only with `custom` pipeline as otherwise a specific `pipeline` could have the `tests` excluded.
128
+
- `kubeVersion`is used for setup `kind` for every running jobs.
129
+
- `kafkaVersion`is used for every running job.
120
130
121
131
### Matrix generation
122
-
Once the event is parsed the mechanism will decide whether Strimzi should be built or already existing images will be used (release rc for example).
123
-
After that job matrix will be generated [run-system-tests](../workflows/run-system-tests.yml) workflow will be invoked for each job defined in the matrix.
132
+
Once the event is parsed the mechanism will decide whether Strimzi should be built or already existing images will be used (release RC for example).
133
+
After that job matrix will be generated and [run-system-tests](../workflows/run-system-tests.yml) workflow will be invoked for each job defined in the matrix.
124
134
125
-
Matrix is generated by action [generate-matrix](../actions/systemtests/generate-matrix) either for custom pipeline mentioned above or for pipelines defined in [pipelines.yaml](../actions/systemtests/generate-matrix/pipelines.yaml).
135
+
Matrix is generated by action [generate-matrix](../actions/systemtests/generate-matrix) either by filtering pipelines/profiles defined in [pipelines.yaml](../actions/systemtests/generate-matrix/pipelines.yaml) or by creating a custom pipeline from passed params.
126
136
127
137
### Workflow depiction
128
138

129
139
130
140
## Security
131
141
To achieve a better security we agreed to not allow everyone to trigger the system tests pipelines in the similar way as we do in Azure.
132
142
The main part in access restriction is [check-permissions](../actions/utils/check-permissions) action that basically check access rights of the user who triggered the pipeline.
133
-
If the user has at least write access or is part of Strimzi org, then it will allow the execution.
143
+
If the user has at least write access or is part of Strimzi org, then it will allow the execution.
134
144
The action is used only from main branch which removes the possibility that a random user will simply change the actions/workflow and the use the resources on his own.
135
145
Also keep in mind that workflow for system tests will be used from a specific branch (main/release-X) for `workflow_dispatch` and `issue_comment` events.
136
146
137
147
Each first-time contributor has to be approved by one of the maintainers which should avoid us to hit some unexpected changes to the workflow to me merged into main.
138
148
139
-
Regarding secrets, the forks are not allowed to use secrets by default.
140
-
Every generated `GITHUB_TOKEN` has only read access to the repo/org without access to the secrets.
149
+
Regarding secrets, the forks are not allowed to use secrets by default.
150
+
Every generated `GITHUB_TOKEN` has only read access to the repo/org without access to the secrets.
151
+
152
+
## Testing workflows and actions
153
+
Unit and integration tests invoked via [actions-tests.yml](../workflows/actions-tests.yml) workflow.
154
+
It uses files specified within [tests](../tests) folder and via [act](https://github.com/nektos/act) it tries to execute the actions and check the outputs.
155
+
Currently, we tests `check-permissions`, `generate-matrix`, and `parse-comment` actions.
0 commit comments