Skip to content

Commit

Permalink
add github action (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
foxdock authored Aug 24, 2024
1 parent 3b06168 commit 8eeca20
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
24 changes: 24 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This workflow will build a Swift project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift

name: Swift

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
name: Swift ${{ matrix.swift }} on ${{ matrix.os }}
strategy:
matrix:
os: [macos-12,macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Build
run: swift build
- name: Run tests
run: swift test
6 changes: 5 additions & 1 deletion Sources/DFService/utils/Runtime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ public extension DF.Runtime {
return ProcessInfo.processInfo.environment["XCODE_RUNNING_FOR_PREVIEWS"] == "1"
}
var isRunningInTests: Bool {
return ProcessInfo.processInfo.environment["XCTestConfigurationFilePath"] != nil
#if canImport(XCTest)
return true
#else
return false
#endif
}
}

Expand Down

0 comments on commit 8eeca20

Please sign in to comment.