Skip to content

Commit

Permalink
ci: add GitHub matrix support
Browse files Browse the repository at this point in the history
Signed-off-by: Loic Devulder <[email protected]>
  • Loading branch information
ldevulder committed Mar 27, 2024
1 parent c672fc3 commit 53d4e52
Show file tree
Hide file tree
Showing 84 changed files with 880 additions and 1,714 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/SCHEDULING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
# Scheduling rules for the CI tests

We try to spread the tests as best as we can to avoid SPOT issue as well as not overload our public cloud zone.

| Test type| Stable | Head 2.7 | Head 2.8 | Head 2.9 |
|:---:|:---:|:---:|:---:|:---:|
| CLI K3s | 1am | 8am | 9am | 10am |
| CLI RKE2 | 2am | 8am | 9am | 10am |
| UI | 3am | 8am | 9am | 10am |
| Test type | Day(s) | Hour |
|:---:|:---:|:---:|
| CLI K3s | Monday to Saturday | 6am |
| CLI K3s Upgrade | Monday to Saturday | 8am |
| CLI RKE2 | Monday to Saturday | 7am |
| CLI RKE2 Upgrade | Monday to Saturday | 9am |
| CLI K3s Airgap | Sunday | 2am |
| CLI K3s Scalability | Sunday | 4am |
| CLI Multicluster | Sunday | 5am |
| UI K3s | Monday to Saturday | 2am |
| UI K3s Upgrade | Monday to Saturday | 4am |
| UI RKE2 | Monday to Saturday | 3am |
| UI RKE2 Upgrade | Monday to Saturday | 5am |
| Update tests description | All days | 11pm |

**NOTE:** please note that the GitHub scheduler uses UTC and our GCP runners are deployed in `us-central1`, so UTC-5.
45 changes: 45 additions & 0 deletions .github/workflows/cli-k3s-airgap-matrix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# This workflow calls the master E2E workflow with custom variables
name: CLI-K3s-Airgap

on:
workflow_dispatch:
inputs:
destroy_runner:
description: Destroy the auto-generated self-hosted runner
default: true
type: boolean
k8s_downstream_version:
description: Rancher cluster downstream version to use
default: '"v1.27.8+k3s2"'
type: string
k8s_upstream_version:
description: Rancher cluster upstream version to use
default: '"v1.26.10+k3s2"'
type: string
rancher_version:
description: Rancher Manager channel/version/head_version to use
default: '"stable/latest"'
type: string
schedule:
# Every Sunday at 2am UTC (9pm in us-central1)
- cron: '0 2 * * 0'

jobs:
cli:
strategy:
fail-fast: false
max-parallel: 4
matrix:
k8s_downstream_version: ${{ fromJSON(format('[{0}]', inputs.k8s_downstream_version || '"v1.27.8+k3s2"')) }}
k8s_upstream_version: ${{ fromJSON(format('[{0}]', inputs.k8s_upstream_version || '"v1.26.10+k3s2"')) }}
rancher_version: ${{ fromJSON(format('[{0}]', inputs.rancher_version || '"stable/latest","latest/devel"')) }}
uses: ./.github/workflows/master_e2e.yaml
secrets:
credentials: ${{ secrets.GCP_CREDENTIALS }}
pat_token: ${{ secrets.SELF_HOSTED_RUNNER_PAT_TOKEN }}
with:
destroy_runner: ${{ github.event_name == 'schedule' && true || inputs.destroy_runner }}
k8s_downstream_version: ${{ matrix.k8s_downstream_version }}
k8s_upstream_version: ${{ matrix.k8s_upstream_version }}
rancher_version: ${{ matrix.rancher_version }}
test_type: airgap
25 changes: 0 additions & 25 deletions .github/workflows/cli-k3s-airgap_rm_latest_dev.yaml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/cli-k3s-airgap_rm_stable.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/cli-k3s-hardened-rm_head_2.7.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/cli-k3s-hardened-rm_head_2.8.yaml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/workflows/cli-k3s-hardened-rm_head_2.9.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/cli-k3s-hardened-rm_stable.yaml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/cli-k3s-hardened-upgrade-reset-rm_stable.yaml

This file was deleted.

19 changes: 14 additions & 5 deletions .github/workflows/cli-k3s-ibs_stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,27 @@ name: CLI-K3s-IBS_Stable
on:
workflow_dispatch:
inputs:
qase_run_id:
description: Qase run ID where the results will be reported
type: string
cluster_type:
description: Cluster type (empty if normal or hardened)
type: string
destroy_runner:
description: Destroy the auto-generated self-hosted runner
default: true
type: boolean
k8s_downstream_version:
description: Rancher cluster downstream version to use
default: v1.27.8+k3s2
type: string
k8s_upstream_version:
description: Rancher cluster upstream version to use
default: v1.26.10+k3s2
type: string
qase_run_id:
description: Qase run ID where the results will be reported
type: string
rancher_version:
description: Rancher Manager channel/version/head_version to use for installation
default: stable/latest/none
default: stable/latest
type: string

jobs:
Expand All @@ -27,9 +35,10 @@ jobs:
pat_token: ${{ secrets.SELF_HOSTED_RUNNER_PAT_TOKEN }}
qase_api_token: ${{ secrets.QASE_API_TOKEN_CLI }}
with:
cluster_name: cluster-k3s
cluster_type: ${{ inputs.cluster_type }}
destroy_runner: ${{ inputs.destroy_runner }}
k8s_downstream_version: ${{ inputs.k8s_downstream_version }}
k8s_upstream_version: ${{ inputs.k8s_upstream_version }}
operator_repo: oci://registry.suse.com/rancher
os_to_test: stable
qase_run_id: ${{ inputs.qase_run_id }}
Expand Down
80 changes: 80 additions & 0 deletions .github/workflows/cli-k3s-matrix.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# This workflow calls the master E2E workflow with custom variables
name: CLI-K3s

on:
workflow_dispatch:
inputs:
ca_type:
description: CA type to use (selfsigned or private)
default: '"selfsigned"'
type: string
cluster_type:
description: Cluster type (empty if normal or hardened)
default: '""'
type: string
destroy_runner:
description: Destroy the auto-generated self-hosted runner
default: true
type: boolean
k8s_downstream_version:
description: Rancher cluster downstream version to use
default: '"v1.27.8+k3s2"'
type: string
k8s_upstream_version:
description: Rancher cluster upstream version to use
default: '"v1.26.10+k3s2"'
type: string
rancher_version:
description: Rancher Manager channel/version/head_version to use
default: '"stable/latest"'
type: string
reset:
description: Allow reset test (mainly used on CLI tests)
default: false
type: boolean
schedule:
# From Monday to Saturday at 6am UTC (1am in us-central1)
- cron: '0 6 * * 1-6'

jobs:
cli:
strategy:
fail-fast: false
max-parallel: 4
matrix:
ca_type: ${{ fromJSON(format('[{0}]', inputs.ca_type || '"selfsigned","private"')) }}
cluster_type: ${{ fromJSON(format('[{0}]', inputs.cluster_type || '""')) }}
k8s_downstream_version: ${{ fromJSON(format('[{0}]', inputs.k8s_downstream_version || '"v1.27.8+k3s2"')) }}
k8s_upstream_version: ${{ fromJSON(format('[{0}]', inputs.k8s_upstream_version || '"v1.26.10+k3s2"')) }}
rancher_version: ${{ fromJSON(format('[{0}]', inputs.rancher_version || '"stable/latest","latest/devel/2.7","latest/devel/2.8","latest/devel/2.9"')) }}
reset: ${{ fromJSON(format('[{0}]', inputs.reset || 'false')) }}
sequential: [ false ]
include:
- ca_type: selfsigned
cluster_type: ""
k8s_downstream_version: v1.27.8+k3s2
k8s_upstream_version: v1.26.10+k3s2
rancher_version: stable/latest
reset: true
sequential: true
- ca_type: private
cluster_type: hardened
k8s_downstream_version: v1.27.8+k3s2
k8s_upstream_version: v1.26.10+k3s2
rancher_version: stable/latest
reset: true
sequential: false
uses: ./.github/workflows/master_e2e.yaml
secrets:
credentials: ${{ secrets.GCP_CREDENTIALS }}
pat_token: ${{ secrets.SELF_HOSTED_RUNNER_PAT_TOKEN }}
with:
ca_type: ${{ matrix.ca_type }}
cluster_type: ${{ matrix.cluster_type }}
destroy_runner: ${{ github.event_name == 'schedule' && true || inputs.destroy_runner }}
k8s_downstream_version: ${{ matrix.k8s_downstream_version }}
k8s_upstream_version: ${{ matrix.k8s_upstream_version }}
rancher_version: ${{ matrix.rancher_version }}
reset: ${{ matrix.reset }}
sequential: ${{ matrix.sequential }}
test_type: cli
Loading

0 comments on commit 53d4e52

Please sign in to comment.