Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: test on Linux #657

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
242 changes: 118 additions & 124 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,115 +14,109 @@ concurrency:
cancel-in-progress: true

jobs:
xcodebuild-latest:
name: xcodebuild (16)
runs-on: macos-15
strategy:
matrix:
command: [test, ""]
platform: [IOS, MACOS]
xcode: ["16.2"]
include:
- { command: test, skip_release: 1 }
steps:
- uses: actions/checkout@v4
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: List available devices
run: xcrun simctl list devices available
- name: Set IgnoreFileSystemDeviceInodeChanges flag
run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
- name: Update mtime for incremental builds
uses: chetan/git-restore-mtime-action@v2
- name: Debug
run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" xcodebuild
- name: Release
if: matrix.skip_release != '1'
run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Release PLATFORM="${{ matrix.platform }}" xcodebuild
- name: Instal lcov
if: matrix.command == 'test' && matrix.platform == 'IOS'
run: brew install lcov
- name: Export code coverage
id: coverage
if: matrix.command == 'test' && matrix.platform == 'IOS'
run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" coverage
- uses: coverallsapp/[email protected]
if: steps.coverage.outcome == 'success'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: lcov.info

xcodebuild:
name: xcodebuild (15)
runs-on: macos-14
strategy:
matrix:
command: [test, ""]
platform: [IOS, MAC_CATALYST, MACOS, TVOS, VISIONOS, WATCHOS]
xcode: [15.2, 15.4]
exclude:
- { xcode: 15.2, command: test }
- { xcode: 15.2, platform: MAC_CATALYST }
- { xcode: 15.2, platform: TVOS }
- { xcode: 15.2, platform: VISIONOS }
- { xcode: 15.2, platform: WATCHOS }
- { command: test, platform: WATCHOS }
include:
- { command: test, skip_release: 1 }
steps:
- uses: actions/checkout@v4
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: Install visionOS runtime
if: matrix.platform == 'visionOS'
run: |
sudo xcodebuild -runFirstLaunch
sudo xcrun simctl list
sudo xcodebuild -downloadPlatform visionOS
sudo xcodebuild -runFirstLaunch
- name: List available devices
run: xcrun simctl list devices available
- name: Cache derived data
uses: actions/cache@v3
with:
path: |
~/.derivedData
key: |
deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift') }}
restore-keys: |
deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-
- name: Set IgnoreFileSystemDeviceInodeChanges flag
run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
- name: Update mtime for incremental builds
uses: chetan/git-restore-mtime-action@v2
- name: Debug
run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" xcodebuild
- name: Release
if: matrix.skip_release != '1'
run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Release PLATFORM="${{ matrix.platform }}" xcodebuild

# linux:
# name: linux
# xcodebuild-latest:
# name: xcodebuild (16)
# runs-on: macos-15
# strategy:
# matrix:
# swift-version: ["5.10"]
# runs-on: ubuntu-latest
# command: [test, ""]
# platform: [IOS, MACOS]
# xcode: ["16.2"]
# include:
# - { command: test, skip_release: 1 }
# steps:
# - uses: actions/checkout@v4
# - uses: swift-actions/setup-swift@v2
# - name: Select Xcode ${{ matrix.xcode }}
# run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
# - name: List available devices
# run: xcrun simctl list devices available
# - name: Set IgnoreFileSystemDeviceInodeChanges flag
# run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
# - name: Update mtime for incremental builds
# uses: chetan/git-restore-mtime-action@v2
# - name: Debug
# run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" xcodebuild
# - name: Release
# if: matrix.skip_release != '1'
# run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Release PLATFORM="${{ matrix.platform }}" xcodebuild
# - name: Instal lcov
# if: matrix.command == 'test' && matrix.platform == 'IOS'
# run: brew install lcov
# - name: Export code coverage
# id: coverage
# if: matrix.command == 'test' && matrix.platform == 'IOS'
# run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" coverage
# - uses: coverallsapp/[email protected]
# if: steps.coverage.outcome == 'success'
# with:
# swift-version: ${{ matrix.swift-version }}
# - name: Cache build
# github-token: ${{ secrets.GITHUB_TOKEN }}
# file: lcov.info

# xcodebuild:
# name: xcodebuild (15)
# runs-on: macos-14
# strategy:
# matrix:
# command: [test, ""]
# platform: [IOS, MAC_CATALYST, MACOS, TVOS, VISIONOS, WATCHOS]
# xcode: [15.2, 15.4]
# exclude:
# - { xcode: 15.2, command: test }
# - { xcode: 15.2, platform: MAC_CATALYST }
# - { xcode: 15.2, platform: TVOS }
# - { xcode: 15.2, platform: VISIONOS }
# - { xcode: 15.2, platform: WATCHOS }
# - { command: test, platform: WATCHOS }
# include:
# - { command: test, skip_release: 1 }
# steps:
# - uses: actions/checkout@v4
# - name: Select Xcode ${{ matrix.xcode }}
# run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
# - name: Install visionOS runtime
# if: matrix.platform == 'visionOS'
# run: |
# sudo xcodebuild -runFirstLaunch
# sudo xcrun simctl list
# sudo xcodebuild -downloadPlatform visionOS
# sudo xcodebuild -runFirstLaunch
# - name: List available devices
# run: xcrun simctl list devices available
# - name: Cache derived data
# uses: actions/cache@v3
# with:
# path: |
# .build
# ~/.derivedData
# key: |
# build-spm-linux-${{ matrix.swift-version }}-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift', '**/Package.resolved') }}
# deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift') }}
# restore-keys: |
# build-spm-linux-${{ matrix.swift-version }}-
# - name: Run tests
# run: swift test --skip IntegrationTests
# deriveddata-xcodebuild-${{ matrix.platform }}-${{ matrix.xcode }}-${{ matrix.command }}-
# - name: Set IgnoreFileSystemDeviceInodeChanges flag
# run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
# - name: Update mtime for incremental builds
# uses: chetan/git-restore-mtime-action@v2
# - name: Debug
# run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Debug PLATFORM="${{ matrix.platform }}" xcodebuild
# - name: Release
# if: matrix.skip_release != '1'
# run: make XCODEBUILD_ARGUMENT="${{ matrix.command }}" CONFIG=Release PLATFORM="${{ matrix.platform }}" xcodebuild

integration-tests:
name: integration tests (linux)
strategy:
matrix:
swift-version: ["6"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: swift-actions/setup-swift@v2
with:
swift-version: ${{ matrix.swift-version }}
- uses: supabase/setup-cli@v1
with:
version: latest
- name: Run integration tests
run: make test-integration

# library-evolution:
# name: Library (evolution)
Expand All @@ -134,28 +128,28 @@ jobs:
# - name: Build for library evolution
# run: make build-for-library-evolution

examples:
name: Examples
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: Cache derived data
uses: actions/cache@v3
with:
path: ~/.derivedData
key: |
deriveddata-examples-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift', '**/Examples/**/*.swift') }}
restore-keys: |
deriveddata-examples-
- name: Select Xcode 16
run: sudo xcode-select -s /Applications/Xcode_16.0.app
- name: Set IgnoreFileSystemDeviceInodeChanges flag
run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
- name: Update mtime for incremental builds
uses: chetan/git-restore-mtime-action@v2
- name: Examples
run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="Examples" XCODEBUILD_ARGUMENT=build xcodebuild
- name: SlackClone
run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="SlackClone" XCODEBUILD_ARGUMENT=build xcodebuild
- name: UserManagement
run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="UserManagement" XCODEBUILD_ARGUMENT=build xcodebuild
# examples:
# name: Examples
# runs-on: macos-15
# steps:
# - uses: actions/checkout@v4
# - name: Cache derived data
# uses: actions/cache@v3
# with:
# path: ~/.derivedData
# key: |
# deriveddata-examples-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift', '**/Examples/**/*.swift') }}
# restore-keys: |
# deriveddata-examples-
# - name: Select Xcode 16
# run: sudo xcode-select -s /Applications/Xcode_16.0.app
# - name: Set IgnoreFileSystemDeviceInodeChanges flag
# run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
# - name: Update mtime for incremental builds
# uses: chetan/git-restore-mtime-action@v2
# - name: Examples
# run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="Examples" XCODEBUILD_ARGUMENT=build xcodebuild
# - name: SlackClone
# run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="SlackClone" XCODEBUILD_ARGUMENT=build xcodebuild
# - name: UserManagement
# run: make DERIVED_DATA_PATH=~/.derivedData SCHEME="UserManagement" XCODEBUILD_ARGUMENT=build xcodebuild
4 changes: 2 additions & 2 deletions Sources/TestHelpers/MockExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import InlineSnapshotTesting
extension Mock {
package func snapshotRequest(
message: @autoclosure () -> String = "",
record isRecording: Bool? = nil,
record: SnapshotTestingConfiguration.Record? = nil,
timeout: TimeInterval = 5,
syntaxDescriptor: InlineSnapshotSyntaxDescriptor = InlineSnapshotSyntaxDescriptor(),
matches expected: (() -> String)? = nil,
Expand All @@ -27,7 +27,7 @@ extension Mock {
assertInlineSnapshot(
of: $0,
as: ._curl,
record: isRecording,
record: record,
timeout: timeout,
syntaxDescriptor: syntaxDescriptor,
matches: expected,
Expand Down
24 changes: 12 additions & 12 deletions Supabase.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-asn1.git",
"state" : {
"revision" : "7faebca1ea4f9aaf0cda1cef7c43aecd2311ddf6",
"version" : "1.3.0"
"revision" : "ae33e5941bb88d88538d0a6b19ca0b01e6c76dcf",
"version" : "1.3.1"
}
},
{
"identity" : "swift-case-paths",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-case-paths",
"state" : {
"revision" : "bc92c4b27f9a84bfb498cdbfdf35d5a357e9161f",
"version" : "1.5.6"
"revision" : "19b7263bacb9751f151ec0c93ec816fe1ef67c7b",
"version" : "1.6.1"
}
},
{
Expand All @@ -95,8 +95,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-concurrency-extras",
"state" : {
"revision" : "163409ef7dae9d960b87f34b51587b6609a76c1f",
"version" : "1.3.0"
"revision" : "82a4ae7170d98d8538ec77238b7eb8e7199ef2e8",
"version" : "1.3.1"
}
},
{
Expand Down Expand Up @@ -131,17 +131,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-identified-collections.git",
"state" : {
"revision" : "2f5ab6e091dd032b63dacbda052405756010dc3b",
"version" : "1.1.0"
"revision" : "322d9ffeeba85c9f7c4984b39422ec7cc3c56597",
"version" : "1.1.1"
}
},
{
"identity" : "swift-snapshot-testing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-snapshot-testing",
"state" : {
"revision" : "42a086182681cf661f5c47c9b7dc3931de18c6d7",
"version" : "1.17.6"
"revision" : "f5bfff796ee8e3bc9a685b7ffba1bf20663eb370",
"version" : "1.18.0"
}
},
{
Expand All @@ -167,8 +167,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/xctest-dynamic-overlay",
"state" : {
"revision" : "a3f634d1a409c7979cabc0a71b3f26ffa9fc8af1",
"version" : "1.4.3"
"revision" : "b444594f79844b0d6d76d70fbfb3f7f71728f938",
"version" : "1.5.1"
}
}
],
Expand Down
Loading
Loading