From 192492025ab00db2285e6c3ab7cec708151a7487 Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Fri, 27 Dec 2024 13:05:33 -0500 Subject: [PATCH] fix(periphery)[1] fixes the test (skips it) if the environment doesn't have a sufficient swift. --- .../github.com/peripheryapp/periphery/package.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/projects/github.com/peripheryapp/periphery/package.yml b/projects/github.com/peripheryapp/periphery/package.yml index dc75ef31d1..998d9cce21 100644 --- a/projects/github.com/peripheryapp/periphery/package.yml +++ b/projects/github.com/peripheryapp/periphery/package.yml @@ -17,7 +17,7 @@ build: # darwin: # apple.com/xcode: '>=15.3' # linux: - # swift.org: 6 + # swift.org: '>=5.10' script: - run: - make build_release @@ -42,13 +42,21 @@ provides: - bin/periphery test: - # dependencies: + dependencies: + gnu.org/sed: '*' + crates.io/semverator: '*' # darwin: # apple.com/xcode: '>=15.3' # linux: - # swift.org: 6 + # swift.org: '>=5.10' script: - test "$(periphery version)" = {{version}} + - SWIFT_VERSION=$(swift --version 2>&1 | sed -n 's/.*Swift version \([0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p') + - | + if ! semverator satisfies '>=5.10' $SWIFT_VERSION; then + echo 'skipping test: swift version too old' + exit 0 + fi - swift package init --name test --type executable - swift build --disable-sandbox - swift package --disable-sandbox describe --type json | tee manifest.json