Skip to content

Commit

Permalink
Simplify ci matrix (#78)
Browse files Browse the repository at this point in the history
Signed-off-by: Ludvig Liljenberg <[email protected]>
  • Loading branch information
ludfjig authored Nov 21, 2024
1 parent a165293 commit 30eb878
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 97 deletions.
35 changes: 7 additions & 28 deletions .github/workflows/Benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,12 @@ jobs:
strategy:
fail-fast: true
matrix:
include:
- build: windows-2022-release-amd
os: [self-hosted, Windows, X64, "1ES.Pool=hld-win2022-amd"]
hypervisor: hyperv
arch: amd
- build: linux-kvm-release-amd
os: [self-hosted, Linux, X64, "1ES.Pool=hld-kvm-amd"]
hypervisor: kvm
arch: amd
- build: linux-mshv-release-amd
os: [self-hosted, Linux, X64, "1ES.Pool=hld-mshv-amd"]
hypervisor: mshv
arch: amd
- build: windows-2022-release-intel
os: [self-hosted, Windows, X64, "1ES.Pool=hld-win2022-intel"]
hypervisor: hyperv
arch: intel
- build: linux-kvm-release-intel
os: [self-hosted, Linux, X64, "1ES.Pool=hld-kvm-intel"]
hypervisor: kvm
arch: intel
- build: linux-mshv-release-intel
os: [self-hosted, Linux, X64, "1ES.Pool=hld-mshv-intel"]
hypervisor: mshv
arch: intel
hypervisor: [hyperv, mshv, kvm] # hyperv is windows, mshv and kvm are linux
cpu: [amd, intel]
config: [release] # don't want to benchmark debug-builds

runs-on: ${{ matrix.os }}
runs-on: ${{ fromJson(format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}"]', matrix.hypervisor == 'hyperv' && 'Windows' || 'Linux', matrix.hypervisor == 'hyperv' && 'win2022' || matrix.hypervisor, matrix.cpu)) }}

steps:
### Setup ###

Expand Down Expand Up @@ -82,7 +61,7 @@ jobs:
run: git fetch --tags origin

- name: Download benchmarks from most recent release
run: just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.arch }} # skip tag parameter to compare to latest stable release
run: just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu }} # skip tag parameter to compare to latest stable release
continue-on-error: true
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -92,6 +71,6 @@ jobs:

- uses: actions/upload-artifact@v4
with:
name: benchmarks_${{runner.os}}_${{matrix.hypervisor}}_${{ matrix.arch }}
name: benchmarks_${{runner.os}}_${{matrix.hypervisor}}_${{ matrix.cpu }}
path: ./target/criterion/
if-no-files-found: error
70 changes: 6 additions & 64 deletions .github/workflows/dep_rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,69 +26,11 @@ jobs:
strategy:
fail-fast: true
matrix:
include:
- build: windows-2022-debug-amd
os: [self-hosted, Windows, X64, "1ES.Pool=hld-win2022-amd"]
hypervisor: hyperv
config: debug
arch: amd
- build: linux-kvm-debug-amd
os: [self-hosted, Linux, X64, "1ES.Pool=hld-kvm-amd"]
hypervisor: kvm
config: debug
arch: amd
- build: linux-mshv-debug-amd
os: [self-hosted, Linux, X64, "1ES.Pool=hld-mshv-amd"]
hypervisor: mshv
config: debug
arch: amd
- build: windows-2022-release-amd
os: [self-hosted, Windows, X64, "1ES.Pool=hld-win2022-amd"]
hypervisor: hyperv
config: release
arch: amd
- build: linux-kvm-release-amd
os: [self-hosted, Linux, X64, "1ES.Pool=hld-kvm-amd"]
hypervisor: kvm
config: release
arch: amd
- build: linux-mshv-release-amd
os: [self-hosted, Linux, X64, "1ES.Pool=hld-mshv-amd"]
hypervisor: mshv
config: release
arch: amd
- build: windows-2022-debug-intel
os: [self-hosted, Windows, X64, "1ES.Pool=hld-win2022-intel"]
hypervisor: hyperv
config: debug
arch: intel
- build: linux-kvm-debug-intel
os: [self-hosted, Linux, X64, "1ES.Pool=hld-kvm-intel"]
hypervisor: kvm
config: debug
arch: intel
- build: linux-mshv-debug-intel
os: [self-hosted, Linux, X64, "1ES.Pool=hld-mshv-intel"]
hypervisor: mshv
config: debug
arch: intel
- build: windows-2022-release-intel
os: [self-hosted, Windows, X64, "1ES.Pool=hld-win2022-intel"]
hypervisor: hyperv
config: release
arch: intel
- build: linux-kvm-release-intel
os: [self-hosted, Linux, X64, "1ES.Pool=hld-kvm-intel"]
hypervisor: kvm
config: release
arch: intel
- build: linux-mshv-release-intel
os: [self-hosted, Linux, X64, "1ES.Pool=hld-mshv-intel"]
hypervisor: mshv
config: release
arch: intel

runs-on: ${{ matrix.os }}
hypervisor: [hyperv, mshv, kvm] # hyperv is windows, mshv and kvm are linux
cpu: [amd, intel]
config: [debug, release]

runs-on: ${{ fromJson(format('["self-hosted", "{0}", "X64", "1ES.Pool=hld-{1}-{2}"]', matrix.hypervisor == 'hyperv' && 'Windows' || 'Linux', matrix.hypervisor == 'hyperv' && 'win2022' || matrix.hypervisor, matrix.cpu)) }}
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -160,7 +102,7 @@ jobs:
run: sudo apt install gh -y

- name: Download benchmarks from "latest"
run: just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.arch}} dev-latest # compare to prerelease
run: just bench-download ${{ runner.os }} ${{ matrix.hypervisor }} ${{ matrix.cpu}} dev-latest # compare to prerelease
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
continue-on-error: true
Expand Down
10 changes: 5 additions & 5 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ run-rust-examples-linux target=default-target: (build-rust target) (run-rust-exa
# Downloads the benchmarks result from the given release tag.
# If tag is not given, defaults to latest release
# Options for os: "Windows", or "Linux"
# Options for Linux hypervisor: "kvm", "hyperv"
# Options for Linux hypervisor: "kvm", "mshv"
# Options for Windows hypervisor: "hyperv"
# Options for arch: "amd", "intel"
bench-download os hypervisor arch tag="":
gh release download {{ tag }} -D ./target/ -p benchmarks_{{ os }}_{{ hypervisor }}_{{ arch }}.tar.gz
# Options for cpu: "amd", "intel"
bench-download os hypervisor cpu tag="":
gh release download {{ tag }} -D ./target/ -p benchmarks_{{ os }}_{{ hypervisor }}_{{ cpu }}.tar.gz
mkdir -p target/criterion {{ if os() == "windows" { "-Force" } else { "" } }}
tar -zxvf target/benchmarks_{{ os }}_{{ hypervisor }}_{{ arch }}.tar.gz -C target/criterion/ --strip-components=1
tar -zxvf target/benchmarks_{{ os }}_{{ hypervisor }}_{{ cpu }}.tar.gz -C target/criterion/ --strip-components=1

# Warning: compares to and then OVERWRITES the given baseline
bench-ci baseline target=default-target:
Expand Down

0 comments on commit 30eb878

Please sign in to comment.