2022-05-03 05:15:53 -04:00
# Actions & Workflows
## Manual Trigger (workflow_dispatch)
2022-05-04 07:52:27 -04:00
It is currently not possible to run a `workflow_dispatch` based workflow on a specific branch, while it is not yet available in `main` branch, from the WebUI. If you would like to test your pipeline changes on a branch, use the [GitHub CLI ](https://github.com/cli/cli ):
2022-05-03 05:15:53 -04:00
```bash
2022-07-20 04:48:01 -04:00
gh workflow run e2e-test-manual.yml \
2022-05-03 05:15:53 -04:00
--ref feat/e2e_pipeline \ # On your specific branch!
2022-09-20 04:38:38 -04:00
-F cloudProvider=gcp \ # With your ...
2022-05-03 05:15:53 -04:00
-F controlNodesCount=1 -F workerNodesCount=2 \ # ... settings
2023-01-19 04:41:07 -05:00
-F machineType=n2d-standard-4 \
-F test=nop
2022-05-03 05:15:53 -04:00
```
### E2E Test Suites
2023-01-19 04:41:07 -05:00
Here are some examples for test suites you might want to run. Values for `sonobuoyTestSuiteCmd` :
2022-05-03 05:15:53 -04:00
* `--mode quick`
2023-06-14 11:50:57 -04:00
* Runs a set of tests that are known to be quick to execute! (< 1 min )
2022-05-03 05:15:53 -04:00
* `--e2e-focus "Services should be able to create a functioning NodePort service"`
2023-06-14 11:50:57 -04:00
* Runs a specific test
2022-05-03 05:15:53 -04:00
* `--mode certified-conformance`
2023-06-14 11:50:57 -04:00
* For K8s conformance certification test suite
2022-05-03 05:15:53 -04:00
Check [Sonobuoy docs ](https://sonobuoy.io/docs/latest/e2eplugin/ ) for more examples.
2022-07-08 12:18:48 -04:00
When using `--mode` be aware that `--e2e-focus` and `e2e-skip` will be overwritten. [Check in the source code ](https://github.com/vmware-tanzu/sonobuoy/blob/e709787426316423a4821927b1749d5bcc90cb8c/cmd/sonobuoy/app/modes.go#L130 ) what the different modes do.
2022-05-03 05:15:53 -04:00
## Local Development
2023-06-14 11:50:57 -04:00
2023-11-27 07:04:41 -05:00
Using [`act` ](https://github.com/nektos/act ) you can run GitHub actions locally.
2022-05-03 05:15:53 -04:00
2022-09-14 07:24:19 -04:00
**These instructions are for internal use.**
In case you want to use the E2E actions externally, you need to adjust other configuration parameters.
2023-11-27 07:04:41 -05:00
Check the assignments made in the [E2E action ](/.github/actions/e2e_test/action.yml ) and adjust any hard-coded values.
2022-05-03 05:15:53 -04:00
### Specific Jobs
```bash
2022-07-20 04:48:01 -04:00
act -j e2e-test-gcp
2022-05-03 05:15:53 -04:00
```
2022-05-04 07:52:27 -04:00
### Simulate a `workflow_dispatch` event
Create a new JSON file to describe the event ([relevant issue](https://github.com/nektos/act/issues/332), there are [no further information about structure of this file ](https://github.com/nektos/act/blob/master/pkg/model/github_context.go#L11 )):
```json
{
"action": "workflow_dispatch",
"inputs": {
"workerNodesCount": "2",
"controlNodesCount": "1",
"cloudProvider": "gcp",
2022-08-31 04:33:33 -04:00
"machineType": "n2d-standard-4",
2022-05-04 07:52:27 -04:00
"sonobuoyTestSuiteCmd": "--mode quick"
}
}
```
2023-11-27 07:04:41 -05:00
Then run `act` with the event as input:
2022-05-04 07:52:27 -04:00
```bash
2022-07-20 04:48:01 -04:00
act -j e2e-test-manual --eventpath event.json
2022-05-04 07:52:27 -04:00
```
2022-05-03 05:15:53 -04:00
### Authorizing GCP
2023-11-27 07:04:41 -05:00
For GCP, OIDC is used to authenticate the CI runner.
This means the workflow cannot be run locally, as the runner created by `act` is not authenticated.
2022-09-14 07:24:19 -04:00
2022-05-04 07:52:27 -04:00
### Authorizing Azure
2023-06-14 11:50:57 -04:00
See [here ](https://docs.edgeless.systems/constellation/workflows/config#creating-iam-credentials ).