Skip to content

Commit 247f2ea

Browse files
committed
ci: use new master(s) workflows
Signed-off-by: Loic Devulder <ldevulder@suse.com>
1 parent 90e9831 commit 247f2ea

8 files changed

+611
-662
lines changed

.github/actions/logs-and-summary/action.yaml

+31-71
Original file line numberDiff line numberDiff line change
@@ -2,78 +2,38 @@
22
name: logs-and-summary
33
description: 'Add logs and summary for an Elemental E2E test'
44

5-
# Action inputs
5+
# Variables to set when calling this action
66
inputs:
7-
ca_type:
8-
description: CA type to use (selfsigned or private)
9-
default: selfsigned
10-
type: string
11-
elemental_support:
12-
description: URL of the elemental support binary
13-
default: https://github.com/rancher/elemental-operator/releases/download/v1.1.4/elemental-support_1.1.4_linux_amd64
14-
type: string
15-
elemental_ui_version:
16-
description: Version of the elemental ui which will be installed (dev/stable)
17-
default: dev
18-
type: string
19-
k8s_version_to_provision:
20-
description: Name and version of installed K8s distribution
21-
required: true
22-
type: string
23-
node_number:
24-
description: Number of nodes to deploy on the provisioned cluster
25-
default: 5
26-
type: string
27-
os_to_test:
28-
description: OS repository to test (dev/staging/stable)
29-
type: string
30-
default: dev
31-
proxy:
32-
description: Deploy a proxy
33-
type: string
34-
rancher_log_collector:
35-
description: URL of the Rancher log collector script
36-
default: https://raw.githubusercontent.com/rancherlabs/support-tools/master/collection/rancher/v2.x/logs-collector/rancher2_logs_collector.sh
37-
type: string
38-
rancher_version:
39-
description: Rancher Manager channel/version/head_version to use for installation
40-
default: stable/latest/none
41-
type: string
42-
sequential:
43-
description: Defines if bootstrapping is done sequentially (true) or in parallel (false)
44-
default: false
45-
type: boolean
46-
test_description:
47-
description: Short description of the test
48-
type: string
49-
test_type:
50-
description: Type of test to run (cli or ui)
51-
default: single_cli
52-
type: string
53-
ui_account:
54-
description: Account used to test RBAC role in UI
55-
type: string
56-
upgrade_image:
57-
description: Image to use for the Elemental OS upgrade
58-
type: string
59-
upgrade_os_channel:
60-
description: Channel to use for the Elemental OS upgrade
61-
type: string
62-
# Secrets inputs!
63-
credentials:
64-
description: Credentials to use to connect
65-
required: true
66-
pat_token:
67-
# A token is needed to be able to add runner on the repo, maybe this can be changed later
68-
# This token is linked to a personal account
69-
# So in case of token issue you have to check (no specific order and for example):
70-
# - the expiration date
71-
# - if the account associated still exists
72-
# - if the person still has access to the repo
73-
description: PAT token used to add runner
74-
required: true
75-
qase_api_token:
76-
description: Qase API token to use for Cypress tests
7+
ca_type:
8+
type: string
9+
elemental_support:
10+
type: string
11+
elemental_ui_version:
12+
type: string
13+
k8s_version_to_provision:
14+
type: string
15+
node_number:
16+
type: string
17+
os_to_test:
18+
type: string
19+
proxy:
20+
type: string
21+
rancher_log_collector:
22+
type: string
23+
rancher_version:
24+
type: string
25+
sequential:
26+
type: boolean
27+
test_description:
28+
type: string
29+
test_type:
30+
type: string
31+
ui_account:
32+
type: string
33+
upgrade_image:
34+
type: string
35+
upgrade_os_channel:
36+
type: string
7737

7838
runs:
7939
using: "composite"

.github/workflows/master_clean-and-delete-runner.yaml

+12-42
Original file line numberDiff line numberDiff line change
@@ -3,94 +3,64 @@ name: (template) Clean and delete GitHub Actions runner on GCP
33

44
on:
55
workflow_call:
6-
# Jobs inputs
6+
# Variables to set when calling this reusable workflow
77
inputs:
88
create_runner_result:
99
description: Status of the create-runner job
1010
required: true
1111
type: string
1212
destroy_runner:
13-
description: Destroy the auto-generated self-hosted runner
14-
default: true
13+
required: true
1514
type: boolean
16-
qase_run_id:
17-
description: Case run ID where the results will be reported
18-
type: string
19-
runner:
20-
description: Name of the GCP runner
15+
runner_hostname:
2116
required: true
2217
type: string
2318
steps_status:
2419
description: Status of all the steps from the previous job
2520
required: true
2621
type: string
27-
uuid:
28-
description: UUID of the GitHub runner
22+
runner_label:
2923
required: true
3024
type: string
3125
zone:
32-
description: GCP zone to host the runner
33-
default: us-central1-a
26+
required: true
3427
type: string
28+
3529
# Secrets to set when calling this reusable workflow
3630
secrets:
3731
credentials:
38-
description: Credentials to use to connect
3932
required: true
4033
pat_token:
41-
# A token is needed to be able to add runner on the repo, maybe this can be changed later
42-
# This token is linked to a personal account
43-
# So in case of token issue you have to check (no specific order and for example):
44-
# - the expiration date
45-
# - if the account associated still exists
46-
# - if the person still has access to the repo
47-
description: PAT token used to add runner
4834
required: true
49-
qase_api_token:
50-
description: Qase API token to use for Cypress tests
5135

5236
jobs:
5337
clean-delete:
5438
runs-on: ubuntu-latest
55-
# Don't block if a step fails
56-
continue-on-error: true
57-
env:
58-
# QASE variables
59-
QASE_API_TOKEN: ${{ secrets.qase_api_token }}
60-
QASE_PROJECT_CODE: ELEMENTAL
61-
QASE_RUN_ID: ${{ inputs.qase_run_id }}
6239
steps:
6340
- name: Checkout
6441
uses: actions/checkout@v4
65-
- name: Setup Go
66-
uses: actions/setup-go@v5
67-
with:
68-
cache-dependency-path: tests/go.sum
69-
go-version-file: tests/go.mod
70-
- name: Finalize Qase Run and publish Results
71-
if: ${{ env.QASE_RUN_ID != '' && !contains(inputs.steps_status, 'cancelled') }}
72-
run: cd tests && make publish-qase-run
73-
- name: Delete Qase Run if job has been cancelled
74-
if: ${{ env.QASE_RUN_ID != '' && contains(inputs.steps_status, 'cancelled') }}
75-
run: cd tests && make delete-qase-run
42+
7643
- name: Authenticate to GCP
7744
uses: google-github-actions/auth@v2
7845
with:
7946
credentials_json: ${{ secrets.credentials }}
47+
8048
- name: Setup gcloud
8149
uses: google-github-actions/setup-gcloud@v2
50+
8251
- name: Delete GCP secrets
8352
run: |
8453
for SECRET in PAT_TOKEN GH_REPO; do
85-
gcloud --quiet secrets delete ${SECRET}_${{ inputs.uuid }} || true
54+
gcloud --quiet secrets delete ${SECRET}_${{ inputs.runner_label }} || true
8655
done
56+
8757
- name: Delete runner
8858
if: ${{ inputs.create_runner_result == 'success' && inputs.destroy_runner == true }}
8959
run: |
9060
# Disable failure on first error, needed for the "delete" check
9161
set +e
9262
# If runner is already deleted we can bypass the error
93-
if ! LOGS=$(gcloud --quiet compute instances delete ${{ inputs.runner }} \
63+
if ! LOGS=$(gcloud --quiet compute instances delete ${{ inputs.runner_hostname }} \
9464
--delete-disks all \
9565
--zone ${{ inputs.zone }} 2>&1); then
9666
echo "${LOGS}" | grep -q "resource .* was not found" || RC=1

0 commit comments

Comments
 (0)