From 1a9b709da4999d4c4420dc8d4c466013db3d61f4 Mon Sep 17 00:00:00 2001 From: Sebastian Sch Date: Mon, 2 Oct 2023 11:38:47 +0300 Subject: [PATCH] Speed up GitHub action runs and save resources - Require short running actions (golangci, test, build) before starting slower virtual-k8s-cluster and only run virtual-ocp when virtual-k8s-cluster succeed - Allow cancellation These two changes together reduce the amount of resources used Signed-off-by: Sebastian Sch --- .github/workflows/virtual-cluster.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/virtual-cluster.yml b/.github/workflows/virtual-cluster.yml index 0d288e5c13..526eeaefc5 100644 --- a/.github/workflows/virtual-cluster.yml +++ b/.github/workflows/virtual-cluster.yml @@ -1,8 +1,20 @@ name: sriov-operator-test on: [pull_request] +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +on: + workflow_run: + workflows: ["Go"] + types: + - completed + jobs: virtual-k8s-cluster: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + name: k8s runs-on: [sriov] steps: @@ -24,6 +36,11 @@ jobs: path: ./artifacts.tar.gz virtual-ocp: + needs: [ + virtual-k8s-cluster + ] + if: ${{ github.event.workflow_run.conclusion == 'success' }} + name: ocp runs-on: [ ocp ] steps: