Skip to content

Commit

Permalink
Don't swallow errors in CI and scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
dabrahams committed Nov 13, 2023
1 parent c631aa6 commit 411194e
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 12 deletions.
4 changes: 1 addition & 3 deletions .github/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

I would like to give a special thanks to all of the people below who have contributed to this project and to all of those who will contribute to it moving forward.

> None so far; you could be the first! See the section below on how to contribute.
>
> To the first person contributing to this project, please remove this block and replace it with your information using the following format: `- [Your Name](https://github.com/YourGitHubUsername)`
- [Dave Abrahams](https://github.com/dabrahams)

## I would like to join this list! How can I help the project?

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/carthage.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Carthage
defaults:
run:
shell: bash -eo pipefail {0}
on:
workflow_dispatch:
push:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/cocoapods.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Cocoapods
defaults:
run:
shell: bash -eo pipefail {0}
on:
workflow_dispatch:
push:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Documentation
defaults:
run:
shell: bash -eo pipefail {0}
on:
workflow_dispatch:
push:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/publish-cocoapods.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Publish CocoaPods
defaults:
run:
shell: bash -eo pipefail {0}
on:
release:
types: [published]
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/swift-package.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Swift Package
defaults:
run:
shell: bash -eo pipefail {0}
on:
workflow_dispatch:
push:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/swiftlint.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: SwiftLint
defaults:
run:
shell: bash -eo pipefail {0}
on:
workflow_dispatch:
push:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/upload-assets.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Upload Assets
defaults:
run:
shell: bash -eo pipefail {0}
on:
release:
types: [published]
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/xcframework.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: XCFramework
defaults:
run:
shell: bash -eo pipefail {0}
on:
workflow_dispatch:
push:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/xcodebuild.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
name: Xcode Project
: Xcode Project
defaults:
run:
shell: bash -eo pipefail {0}
on:
workflow_dispatch:
push:
Expand Down
6 changes: 6 additions & 0 deletions Sources/Half/Functions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
// Copyright © 2022 SomeRandomiOSDev. All rights reserved.
//

#if os(Linux)
import Glibc
#else
import Darwin
#endif

// Implmentation of public functions found in swift/stdlib/public/Platform for Half precision.
//
// For the sake of simplicity, we'll implement these functions by casting up the
Expand Down
6 changes: 3 additions & 3 deletions scripts/carthage.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env bash -e -o pipefail
#
# carthage.sh
# Copyright © 2022 SomeRandomiOSDev. All rights reserved.
Expand All @@ -8,9 +8,9 @@
# Needed to circumvent an issue with Carthage version < 0.37.0: https://github.com/Carthage/Carthage/issues/3019

VERSION="$(carthage version)"
"$(dirname "$0")/versions.sh" "$VERSION" "0.37.0"
comparison=$("$(dirname "$0")/versions.sh" "$VERSION" "0.37.0"; echo $?)

if [ $? -ge 0 ]; then
if [ "$comparison" -ge 0 ]; then
# Carthage version is greater than or equal to 0.37.0 meaning we can use the --use-xcframeworks flag
carthage "$@" --use-xcframeworks
else
Expand Down
2 changes: 1 addition & 1 deletion scripts/findproject.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env bash -e -o pipefail
#
# findproject.sh
# Copyright © 2022 SomeRandomiOSDev. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion scripts/printformat.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env bash -e -o pipefail
#
# printformat.sh
# Copyright © 2022 SomeRandomiOSDev. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion scripts/resolvepath.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env bash -e -o pipefail
#
# resolvepath.sh
# Copyright © 2022 SomeRandomiOSDev. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion scripts/versions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env bash -e -o pipefail
#
# versions.sh
# Copyright © 2022 SomeRandomiOSDev. All rights reserved.
Expand Down
2 changes: 1 addition & 1 deletion scripts/xcframework.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env bash -e -o pipefail
#
# xcframework.sh
# Copyright © 2022 SomeRandomiOSDev. All rights reserved.
Expand Down

0 comments on commit 411194e

Please sign in to comment.