Skip to content

Commit

Permalink
.github/workflows: Set DID_UNSHARE programmatically instead of explic…
Browse files Browse the repository at this point in the history
…itly

Instead of having to define the DID_UNSHARE value explicitly as part of the test
matrix, set the environment variable programmatically based on the kernel
version. This removes the need for a lot of copy-paste to accommodate the two
old kernel versions, now that we also have clang versions as part of the test
matrix.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
  • Loading branch information
tohojo committed Aug 5, 2024
1 parent b35f074 commit 72e907a
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions .github/workflows/selftests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,23 @@ jobs:
- "6.6.14-200.fc39"
- "6.1.9-200.fc37"
- "5.16.8-200.fc35"
DID_UNSHARE:
- 0
- "5.11.0-156.fc34"
- "5.6.19-300.fc32"
CLANG_VERSION:
- 16
- 17
- 18
- 19
include:
- KERNEL_VERSION: "5.11.0-156.fc34"
DID_UNSHARE: 1
- KERNEL_VERSION: "5.6.19-300.fc32"
DID_UNSHARE: 1
fail-fast: false

env:
KERNEL_VERSION: ${{ matrix.KERNEL_VERSION }}
DID_UNSHARE: ${{ matrix.DID_UNSHARE }}
CLANG_VERSION: ${{ matrix.CLANG_VERSION }}
CLANG: clang-${{ matrix.CLANG_VERSION }}
LLC: llc-${{ matrix.CLANG_VERSION }}
LLVM_STRIP: llvm-strip-${{ matrix.CLANG_VERSION }}
# can't use unshare on old kernels
DID_UNSHARE: ${{ (startsWith(matrix.KERNEL_VERSION, "5.6") || startsWith(matrix.KERNEL_VERSION, "5.11")) && 1 || 0 }}

steps:
- name: Check out repository code
Expand Down

0 comments on commit 72e907a

Please sign in to comment.