Skip to content

Commit 333170f

Browse files
authored
Add workflow for testing our custom actions (strimzi#11769)
Signed-off-by: Jakub Stejskal <xstejs24@gmail.com>
1 parent a06c913 commit 333170f

42 files changed

Lines changed: 1627 additions & 8 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actionlint.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Configuration for GitHub actions linting - docker://rhysd/actionlint:latest
2+
# For more info see https://github.com/rhysd/actionlint/blob/main/docs/config.md
3+
4+
# Configuration related to self-hosted runner.
5+
self-hosted-runner:
6+
# Labels of self-hosted runner in array of strings.
7+
# Add other runners if needed
8+
labels:
9+
# container runners
10+
- oracle-2cpu-8gb-arm64
11+
- oracle-2cpu-8gb-x86_64
12+
# VM runners
13+
- oracle-vm-2cpu-8gb-x86-64
14+
- oracle-vm-2cpu-8gb-arm64
15+
- oracle-vm-4cpu-16gb-x86-64
16+
- oracle-vm-4cpu-16gb-arm64
17+
- oracle-vm-8cpu-32gb-x86-64
18+
- oracle-vm-8cpu-32gb-arm64
19+
20+
# Path-specific configurations.
21+
paths:
22+
.github/workflows/run-system-tests.yml:
23+
ignore:
24+
# Ignore the specific error from shellcheck
25+
- 'shellcheck reported issue in this script: SC2086:.+'

.github/actions/check-permissions/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ runs:
2020
with:
2121
script: |
2222
const {owner, repo} = context.repo;
23-
const actor = process.env.GITHUB_ACTOR;
23+
// Get actor from event payload first, fallback to GITHUB_ACTOR
24+
const actor = context.payload.actor ||
25+
context.actor ||
26+
process.env.GITHUB_ACTOR;
2427
const team = process.env.TEAM
2528
const denialMessage = process.env.MESSAGE
2629

.github/actions/generate-matrix/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ inputs:
3939
default_tests:
4040
description: "Default JUnit5 tests that will be executed"
4141
default: ""
42+
runnerArch:
43+
description: "Architecture of GitHub runner"
44+
required: false
45+
default: "amd64"
4246

4347
outputs:
4448
matrix:
@@ -52,7 +56,8 @@ runs:
5256
- name: Install yq
5357
uses: ./.github/actions/install-yq
5458
with:
55-
architecture: "arm64"
59+
architecture: ${{ inputs.runnerArch }}
60+
5661
- name: Generate Matrix JSON
5762
id: gen
5863
shell: bash

.github/actions/parse-comment/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ outputs:
5555
kubeVersion:
5656
description: "Version of Kubernetes used for tests"
5757
value: ${{ steps.should_run.outputs.kubeVersion }}
58+
parallel:
59+
description: "How many tests will be executed in parallel"
60+
value: ${{ steps.parse_comment.output.parallel }}
5861
# Checkout ref outputs
5962
repo_owner:
6063
description: "Owner of the repository a.k.a org name"
@@ -149,7 +152,7 @@ runs:
149152
FG_VALUE="$DEFAULT_FEATURE_GATES"
150153
RBAC_VALUE="$DEFAULT_RBAC_SCOPE"
151154
COI_VALUE="$DEFAULT_OPERATOR_INSTALL_TYPE"
152-
PARALLEL_VALUE=""
155+
PARALLEL_VALUE="1"
153156
GROUPS_VALUE=""
154157
TESTS_VALUE=""
155158
KAFKA_VERSION_VALUE=""
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"event_name": "pull_request",
3+
"action": "opened",
4+
"actor": "frawless",
5+
"pull_request": {
6+
"number": 123,
7+
"title": "Test authorized user",
8+
"head": {
9+
"ref": "test-branch",
10+
"sha": "abc123456789",
11+
"repo": {
12+
"name": "ci-playground",
13+
"owner": { "login": "frawless" }
14+
}
15+
}
16+
},
17+
"repository": {
18+
"name": "ci-playground",
19+
"owner": {
20+
"login": "frawless",
21+
"type": "User"
22+
}
23+
}
24+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"event_name": "pull_request",
3+
"action": "opened",
4+
"actor": "pepa",
5+
"pull_request": {
6+
"number": 66666666666,
7+
"title": "Test unauthorized user",
8+
"head": {
9+
"ref": "test-branch",
10+
"sha": "def987654321",
11+
"repo": {
12+
"name": "ci-playground",
13+
"owner": { "login": "pepa" }
14+
}
15+
}
16+
},
17+
"repository": {
18+
"name": "ci-playground",
19+
"owner": {
20+
"login": "frawless",
21+
"type": "User"
22+
}
23+
}
24+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"event_name": "workflow_dispatch",
3+
"action": "workflow_dispatch",
4+
"inputs": {
5+
"pipelines": "",
6+
"profiles": ""
7+
},
8+
"repository": {
9+
"name": "ci-playground",
10+
"owner": { "login": "frawless" }
11+
}
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"event_name": "workflow_dispatch",
3+
"action": "workflow_dispatch",
4+
"inputs": {
5+
"pipelines": "nonexistent-pipeline",
6+
"profiles": ""
7+
},
8+
"repository": {
9+
"name": "ci-playground",
10+
"owner": { "login": "frawless" }
11+
}
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"event_name": "workflow_dispatch",
3+
"action": "workflow_dispatch",
4+
"inputs": {
5+
"pipelines": "regression,smoke",
6+
"profiles": ""
7+
},
8+
"repository": {
9+
"name": "ci-playground",
10+
"owner": { "login": "frawless" }
11+
}
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"event_name": "workflow_dispatch",
3+
"action": "workflow_dispatch",
4+
"inputs": {
5+
"pipelines": "smoke",
6+
"profiles": "operators,operands"
7+
},
8+
"repository": {
9+
"name": "ci-playground",
10+
"owner": { "login": "frawless" }
11+
}
12+
}

0 commit comments

Comments
 (0)