Skip to content

Commit

Permalink
Speed up GitHub action runs and save resources
Browse files Browse the repository at this point in the history
- 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 <sebassch@gmail.com>
  • Loading branch information
SchSeba committed Oct 2, 2023
1 parent d8a33a8 commit c5770d0
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 50 deletions.
59 changes: 58 additions & 1 deletion .github/workflows/go.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Go
name: Test SR-IOV Operator

on: [push, pull_request]

concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:

build:
Expand Down Expand Up @@ -88,3 +92,56 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.out

virtual-k8s-cluster:
name: k8s
needs: [
build,
test,
golangci,
]
runs-on: [ sriov ]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: run test
run: make test-e2e-conformance-virtual-k8s-cluster-ci

- uses: actions/upload-artifact@v3
if: always()
with:
name: k8s-artifact
path: ./k8s-artifacts

virtual-ocp:
name: ocp
needs: [
build,
test,
golangci,
]

runs-on: [ ocp ]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: run test
run: make test-e2e-conformance-virtual-ocp-cluster-ci

- uses: actions/upload-artifact@v3
if: always()
with:
name: ocp-artifact
path: ./ocp-artifacts
45 changes: 0 additions & 45 deletions .github/workflows/virtual-cluster.yml

This file was deleted.

3 changes: 1 addition & 2 deletions hack/run-e2e-conformance-virtual-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,5 @@ hack/deploy-wait.sh

if [ -z $SKIP_TEST ]; then
echo "## run sriov e2e conformance tests"
SUITE=./test/conformance JUNIT_OUTPUT=`pwd`/artifacts hack/run-e2e-conformance.sh
tar -zcvf artifacts.tar.gz ./artifacts
SUITE=./test/conformance JUNIT_OUTPUT=`pwd`/k8s-artifacts hack/run-e2e-conformance.sh
fi
3 changes: 1 addition & 2 deletions hack/run-e2e-conformance-virtual-ocp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,5 @@ hack/deploy-wait.sh

if [ -z $SKIP_TEST ]; then
echo "## run sriov e2e conformance tests"
SUITE=./test/conformance JUNIT_OUTPUT=`pwd`/artifacts hack/run-e2e-conformance.sh
tar -zcvf artifacts.tar.gz `pwd`/artifacts
SUITE=./test/conformance JUNIT_OUTPUT=`pwd`/ocp-artifacts hack/run-e2e-conformance.sh
fi

0 comments on commit c5770d0

Please sign in to comment.