KM valgrind Pipeline #680
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
# | |
# Copyright 2022 Kontain Inc | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
name: KM valgrind Pipeline | |
on: | |
# push: | |
# branches: [master] | |
# paths-ignore: | |
# - "**.md" # all .md files in repo | |
# - "**/docs/**" # all content of all docs/ dirs in repo | |
# - compile_commands.json | |
# - .vscode/** | |
# - km-releases | |
# - payloads/** | |
# - "**/L0-image**" | |
schedule: | |
# Posix cron format: | |
# https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07 | |
# Minute Hour DayOfMonth MonthOfYear DayOfWeek | |
- cron: "0 9 * * *" # Daily build 2am pacific time (UTC + 7) | |
# Github doc says: | |
# Scheduled workflows run on the latest commit on the default or base branch. | |
# The shortest interval you can run scheduled workflows is once every 5 minutes. | |
# Manual trigger. | |
# See https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/ | |
workflow_dispatch: | |
env: | |
BUILDENV_IMAGE_VERSION: latest # use this for all buildenv containers | |
IMAGE_VERSION: vg-ci-${{ github.run_number }} # use this for all other containers | |
SP_SUBSCRIPTION_ID: ${{ secrets.SP_SUBSCRIPTION_ID }} | |
SP_APPID: ${{ secrets.SP_APPID }} | |
SP_PASSWORD: ${{ secrets.SP_PASSWORD }} | |
SP_TENANT: ${{ secrets.SP_TENANT }} | |
# TRACE: true # uncomment to enable '-x' in all bash scripts | |
jobs: | |
# starts self-hosted runner in AWS and Azure. They are NOT ephemeral and will run until cleanup in the stop-runner | |
start-runners: | |
uses: ./.github/workflows/start-cloud-runners.yaml | |
secrets: inherit | |
km-build: | |
name: Build KM, push test image | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: ./.github/actions/km-build | |
with: | |
build-flavor: valgrind | |
km-test: | |
name: KM, KVM on Azure | |
runs-on: ${{ fromJSON(needs.start-runners.outputs.run-ons)['azure'] }} | |
needs: [start-runners, km-build] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: ./.github/actions/run-tests | |
with: | |
kernel: kvm | |
build-flavor: valgrind | |
timeout-minutes: 60 | |
kkm-test-vms: | |
name: KM tests, KKM AWS | |
needs: [start-runners, km-build] | |
runs-on: ${{ fromJSON(needs.start-runners.outputs.run-ons)['ec2'] }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: ./.github/actions/run-tests | |
with: | |
kernel: kkm | |
build-flavor: valgrind | |
timeout-minutes: 60 | |
slack-workflow-status: | |
name: Notify slack, if needed | |
runs-on: ubuntu-latest | |
# 'contains' shows how to add conditions, e.g. on workflow 'name:', or many other contexts. | |
# see https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions | |
if: (failure() && github.ref == 'refs/heads/master') || | |
contains(github.workflow, 'noisy') | |
# Dependencies. (A skipped dependency is considered satisfied) | |
needs: | |
[ | |
km-build, | |
km-test, | |
kkm-test-vms, | |
] | |
steps: | |
- name: Send notification to slack | |
uses: Gamesight/slack-workflow-status@master | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
slack_webhook_url: ${{ secrets.SLACK_WEBHOOK_URL }} | |
include_jobs: true | |
channel: "#build_and_test" | |
name: "CI workflow status" | |
icon_emoji: ":thumbsdown:" | |
# This step is to clean up on-demand runner. They work in conjunction with start-runner. | |
# Make sure to add dependencies in both "needs" clauses | |
stop-runner: | |
if: always() | |
needs: [start-runners, km-test, kkm-test-vms] | |
uses: ./.github/workflows/stop-cloud-runners.yaml | |
with: | |
dependencies: ${{ toJSON(needs) }} | |
secrets: inherit |