OS tests :: Nightly #266
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nightly trigger for OS testing. See ../../hack/ostests/README.md for details. | |
name: "OS tests :: Nightly" | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 30 2 * * * | |
env: | |
DISTRIBUTIONS: >- | |
[ | |
["al2023"], | |
["alpine_3_17"], | |
["centos_7", "centos_8", "centos_9"], | |
["debian_10", "debian_11", "debian_12"], | |
["fcos_38"], | |
["fedora_38"], | |
["flatcar"], | |
["oracle_7_9", "oracle_8_7", "oracle_9_1"], | |
["rhel_7", "rhel_8", "rhel_9"], | |
["rocky_8", "rocky_9"], | |
["ubuntu_2004", "ubuntu_2204", "ubuntu_2304"] | |
] | |
NETWORK_PROVIDERS: >- | |
[ | |
"kuberouter", | |
"calico" | |
] | |
KUBE_PROXY_MODES: >- | |
[ | |
"iptables", | |
"ipvs" | |
] | |
jobs: | |
select: | |
name: Select | |
runs-on: ubuntu-latest | |
outputs: | |
os: ${{ steps.select.outputs.os }} | |
network-provider: ${{ steps.select.outputs.network-provider }} | |
steps: | |
# Generate a "well-distributed" list of all possible parameter | |
# combinations and select an entry based on the current day. This approach | |
# ensures that, if run once each day, there is a significant variation in | |
# parameter values each day while also guaranteeing that every combination | |
# will be chosen at some point. | |
- name: Select | |
id: select | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
const distros = JSON.parse(process.env.DISTRIBUTIONS) | |
const networkProviders = JSON.parse(process.env.NETWORK_PROVIDERS) | |
const kubeProxyModes = JSON.parse(process.env.KUBE_PROXY_MODES) | |
const oses = [] | |
for (let i = 0; ; i++) { | |
let added = false | |
for (const distro of distros) { | |
if (i < distro.length) { | |
oses.push(distro[i]) | |
added = true | |
} | |
} | |
if (!added) { | |
break | |
} | |
} | |
const combinations = [] | |
for (const [kpmIdx, _] of kubeProxyModes.entries()) { | |
for (const [npIdx, _] of networkProviders.entries()) { | |
for (const [osIdx, os] of oses.entries()) { | |
combinations.push([ | |
os, | |
networkProviders[(npIdx + osIdx) % networkProviders.length], | |
kubeProxyModes[(kpmIdx + osIdx) % kubeProxyModes.length], | |
]) | |
} | |
} | |
} | |
const daysSinceEpoch = Math.floor(Date.now() / (24 * 60 * 60 * 1000)) | |
const [os, networkProvider, kubeProxyMode] = | |
combinations[daysSinceEpoch % combinations.length] | |
console.log(`Selected ${os}/${networkProvider}`) | |
core.setOutput('os', os) | |
core.setOutput('network-provider', networkProvider) | |
core.setOutput('kube-proxy-mode', kubeProxyMode) | |
build: | |
name: Build | |
uses: ./.github/workflows/build-k0s.yml | |
with: { target-os: linux, target-arch: amd64 } | |
e2e-tests: | |
name: "${{ needs.select.outputs.os }} :: ${{ needs.select.outputs.network-provider }}" | |
needs: [select, build] | |
uses: ./.github/workflows/ostests-e2e.yaml | |
with: | |
os: ${{ needs.select.outputs.os }} | |
network-provider: ${{ needs.select.outputs.network-provider }} | |
secrets: | |
aws-access-key-id: ${{ secrets.AWS_TERRAFORM_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_TERRAFORM_KEY }} | |
aws-session-token: ${{ secrets.AWS_SESSION_TOKEN }} |