Skip to content

Commit

Permalink
[GHA] Benchmark job (#2780)
Browse files Browse the repository at this point in the history
  • Loading branch information
FranzBusch authored Jul 11, 2024
1 parent fd31c95 commit 8631602
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 2 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ on:
jobs:
call-reusable-pull-request-workflow:
name: Checks
uses: ./.github/workflows/reusable_pull_request.yml
uses: ./.github/workflows/reusable_pull_request.yml
with:
benchmarks_linux_package_path: "Benchmarks"
42 changes: 41 additions & 1 deletion .github/workflows/reusable_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ on:
type: boolean
description: "Boolean to enable the unit tests linux job. Defaults to true."
default: true
benchmarks_linux_enabled:
type: boolean
description: "Boolean to enable the benchmarks linux job. Defaults to true."
default: true
benchmarks_linux_package_path:
type: string
description: "Path to the package containing the benchmarks. Defaults to the repository root."
default: "."
api_breakage_check_enabled:
type: boolean
description: "Boolean to enable the API breakage check job. Defaults to true."
Expand Down Expand Up @@ -40,7 +48,7 @@ jobs:
swift:
- image: swift:5.8-jammy
- image: swift:5.9-jammy
- image: swift:5.10-noble
- image: swift:5.10-jammy
- image: swiftlang/swift:nightly-6.0-jammy
- image: swiftlang/swift:nightly-main-jammy
container:
Expand All @@ -51,6 +59,38 @@ jobs:
uses: actions/checkout@v4
- name: Run tests
run: swift test

benchmarks-linux:
name: Benchmarks
if: ${{ inputs.benchmarks_linux_enabled }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
swift:
- image: swift:5.8-jammy
swift_version: "5.8"
- image: swift:5.9-jammy
swift_version: "5.9"
- image: swift:5.10-jammy
swift_version: "5.10"
- image: swiftlang/swift:nightly-6.0-jammy
swift_version: "nightly-next"
- image: swiftlang/swift:nightly-main-jammy
swift_version: "nightly-main"
container:
image: ${{ matrix.swift.image }}
timeout-minutes: 20
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run tests
env:
PACKAGE_PATH: ${{ inputs.benchmarks_linux_package_path }}
SWIFT_VERSION: ${{ matrix.swift.swift_version }}
run: |
apt-get update -y -q && apt-get install -y -q libjemalloc-dev
swift package --package-path ${PACKAGE_PATH} --disable-sandbox benchmark baseline check --check-absolute-path ${PACKAGE_PATH}/Thresholds/${SWIFT_VERSION}/
api-breakage-check:
name: API breakage check
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"mallocCountTotal" : 12
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"mallocCountTotal" : 108
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"mallocCountTotal" : 165000
}

0 comments on commit 8631602

Please sign in to comment.