mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-08-22 16:47:24 +00:00
simplify sharding in package tests for CI; increase to 12 shards (#4158)
* simplify sharding in package tests for CI; increase to 12 shards Signed-off-by: Avi Deitcher <avi@deitcher.net> * for CI setup-go action, determine it based on go.mod file Signed-off-by: Avi Deitcher <avi@deitcher.net> --------- Signed-off-by: Avi Deitcher <avi@deitcher.net>
This commit is contained in:
parent
999110c6de
commit
cacc2bbb8e
48
.github/workflows/ci.yml
vendored
48
.github/workflows/ci.yml
vendored
@ -1,6 +1,9 @@
|
||||
name: LinuxKit CI
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
TOTAL_SHARDS: 12 # change here once
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build & Test
|
||||
@ -35,15 +38,15 @@ jobs:
|
||||
runs-on: ${{ matrix.target.runner }}
|
||||
steps:
|
||||
|
||||
- name: Set up Go 1.22
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22.3
|
||||
id: go
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Go based on go.mod
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'src/cmd/linuxkit/go.mod'
|
||||
id: go
|
||||
|
||||
- name: Set path
|
||||
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||
env:
|
||||
@ -151,13 +154,42 @@ jobs:
|
||||
run: |
|
||||
linuxkit cache ls
|
||||
|
||||
gen_package_test_matrix:
|
||||
name: Generate Package Test Matrix
|
||||
needs: [ build_packages, build ]
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
shard_list: ${{ steps.mk.outputs.list }}
|
||||
steps:
|
||||
- name: Generate Test Matrix
|
||||
id: mk
|
||||
shell: bash
|
||||
run: |
|
||||
set -x
|
||||
N="${{ env.TOTAL_SHARDS }}"
|
||||
# Priority: repo var SHARDS → event-based default (PR=6, else 10)
|
||||
if [ -n "${{ vars.SHARDS }}" ]; then
|
||||
N="${{ vars.SHARDS }}"
|
||||
fi
|
||||
|
||||
# Build JSON array ["1/N","2/N",...,"N/N"]
|
||||
shards=""
|
||||
for i in $(seq 1 "$N"); do
|
||||
if [ -z "$shards" ]; then
|
||||
shards="\"$i/$N\""
|
||||
else
|
||||
shards="$shards,\"$i/$N\""
|
||||
fi
|
||||
done
|
||||
echo "list=[$shards]" >> "$GITHUB_OUTPUT"
|
||||
|
||||
test_packages:
|
||||
name: Packages Tests
|
||||
needs: [ build_packages, build ]
|
||||
needs: [ build_packages, build, gen_package_test_matrix ]
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
shard: [1/10,2/10,3/10,4/10,5/10,6/10,7/10,8/10,9/10,10/10]
|
||||
shard: ${{ fromJson(needs.gen_package_test_matrix.outputs.shard_list) }}
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
|
10
.github/workflows/package_release.yml
vendored
10
.github/workflows/package_release.yml
vendored
@ -9,13 +9,13 @@ jobs:
|
||||
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/pkg-v')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Set up Go 1.22
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22.3
|
||||
id: go
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Go based on go.mod
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'src/cmd/linuxkit/go.mod'
|
||||
id: go
|
||||
- name: Ensure bin/ directory
|
||||
run: mkdir -p bin
|
||||
- name: Install linuxkit
|
||||
|
24
.github/workflows/release.yml
vendored
24
.github/workflows/release.yml
vendored
@ -10,14 +10,14 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Set up Go 1.122
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22.3
|
||||
id: go
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Go based on go.mod
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'src/cmd/linuxkit/go.mod'
|
||||
id: go
|
||||
|
||||
|
||||
- name: Set path
|
||||
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||
@ -42,14 +42,14 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
|
||||
- name: Set up Go 1.122
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: 1.22.3
|
||||
id: go
|
||||
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v4
|
||||
- name: Set up Go based on go.mod
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version-file: 'src/cmd/linuxkit/go.mod'
|
||||
id: go
|
||||
|
||||
|
||||
- name: Set path
|
||||
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
|
||||
|
@ -1,8 +1,6 @@
|
||||
module github.com/linuxkit/linuxkit/src/cmd/linuxkit
|
||||
|
||||
go 1.23.0
|
||||
|
||||
toolchain go1.24.2
|
||||
go 1.24.2
|
||||
|
||||
require (
|
||||
github.com/Azure/azure-sdk-for-go v56.3.0+incompatible
|
||||
|
Loading…
Reference in New Issue
Block a user