Skip to content

Commit

Permalink
[GHA] Benchmark job
Browse files Browse the repository at this point in the history
# Motivation

We need to run our `benchmark-package` based benchmarks on GH action as well. This is another part that we can make reusable for other packages.

# Modification

Add a new `benchmarks-linux` job to the reusable workflow.

# Result

One more CI flow migrated.
  • Loading branch information
FranzBusch committed Jul 10, 2024
1 parent fd31c95 commit c9bf996
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/reusable_pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ on:
unit_tests_linux_enabled:
type: boolean
description: "Boolean to enable the unit tests linux job. Defaults to 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 @@ -51,6 +58,36 @@ 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-noble
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: swift package --package-path ${PACKAGE_PATH} benchmark --disable-sandbox baseline check --check-absolute-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 c9bf996

Please sign in to comment.