From ca43f1e8036180cc666872c8734a952725421737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 30 Jan 2022 17:59:43 +0100 Subject: [PATCH 1/8] Test macOS, All Xcodes and Swifts --- .github/workflows/CI.yml | 66 ++++++++++++++++++++++++++++++++-------- 1 file changed, 54 insertions(+), 12 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2079a3f6c..c2570c6d1 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,19 +1,61 @@ -name: CI +name: "GRDB CI" on: push: - branches: [ master, development ] + branches: + - master + - development + paths: + - 'GRDB/**' + - 'Tests/**' + - '.github/workflows/**' + - 'Package.swift' pull_request: - branches: [ master, development ] + paths: + - 'GRDB/**' + - 'Tests/**' + - '.github/workflows/**' + - 'Package.swift' +concurrency: + group: ${{ github.ref_name }} + cancel-in-progress: true jobs: - build: - - runs-on: macos-latest - + macOS: + name: Test macOS, All Xcodes and Swifts + runs-on: ${{ matrix.runsOn }} + env: + DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}/Contents/Developer" + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + include: + - xcode: "Xcode_13.3.1.app" + runsOn: macOS-12 + name: "macOS 12, Xcode 13.3.1, Swift 5.6" + shell: "/bin/zsh {0}" + - xcode: "Xcode_13.2.1.app" + runsOn: macOS-11 + name: "macOS 11, Xcode 13.2.1, Swift 5.5.2" + shell: "/bin/zsh {0}" + - xcode: "Xcode_13.1.app" + runsOn: macOS-11 + name: "macOS 11, Xcode 13.1, Swift 5.5.1" + shell: "/bin/zsh {0}" + - xcode: "Xcode_13.0.app" + runsOn: macOS-11 + name: "macOS 11, Xcode 13.0, Swift 5.5.0" + shell: "/bin/zsh {0}" + - xcode: "Xcode_12.5.1.app" + runsOn: macOS-11 + name: "macOS 11, Xcode 12.5.1, Swift 5.4" + shell: "/bin/zsh {0}" + - xcode: "Xcode_12.4.app" + runsOn: macOS-10.15 + name: "macOS 10.15, Xcode 12.4, Swift 5.3" + shell: "/bin/zsh {0}" steps: - - uses: actions/checkout@v2 - - name: Build - run: swift build -v - - name: Run tests - run: swift test -v + - uses: actions/checkout@v2 + - name: ${{ matrix.name }} + run: make test_framework_GRDBOSX_maxSwift From 2ec0a4c69db5f5dca26e8cddb206b28d63393a66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 22 May 2022 13:25:49 +0200 Subject: [PATCH 2/8] More tests --- .github/workflows/CI.yml | 97 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 94 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index c2570c6d1..ed9faf403 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -24,9 +24,7 @@ jobs: macOS: name: Test macOS, All Xcodes and Swifts runs-on: ${{ matrix.runsOn }} - env: - DEVELOPER_DIR: "/Applications/${{ matrix.xcode }}/Contents/Developer" - timeout-minutes: 10 + timeout-minutes: 20 strategy: fail-fast: false matrix: @@ -59,3 +57,96 @@ jobs: - uses: actions/checkout@v2 - name: ${{ matrix.name }} run: make test_framework_GRDBOSX_maxSwift + iOS: + name: Test iOS + runs-on: ${{ matrix.runsOn }} + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + include: + - xcode: "Xcode_13.3.1.app" + runsOn: macOS-12 + name: "macOS 12, Xcode 13.3.1, Swift 5.6" + shell: "/bin/zsh {0}" + - xcode: "Xcode_12.4.app" + runsOn: macOS-10.15 + name: "macOS 10.15, Xcode 12.4, Swift 5.3" + shell: "/bin/zsh {0}" + steps: + - uses: actions/checkout@v2 + - name: ${{ matrix.name }} + run: make test_framework_GRDBiOS_maxTarget_maxSwift + SPM: + name: Test SPM + runs-on: ${{ matrix.runsOn }} + timeout-minutes: 40 + strategy: + fail-fast: false + matrix: + include: + - xcode: "Xcode_13.3.1.app" + runsOn: macOS-12 + name: "macOS 12, Xcode 13.3.1, Swift 5.6" + shell: "/bin/zsh {0}" + steps: + - uses: actions/checkout@v2 + - name: ${{ matrix.name }} + run: make test_SPM test_install_SPM + SQLCipher4: + name: Test SQLCipher4 + runs-on: ${{ matrix.runsOn }} + timeout-minutes: 40 + strategy: + fail-fast: false + matrix: + include: + - xcode: "Xcode_13.3.1.app" + runsOn: macOS-12 + name: "macOS 12, Xcode 13.3.1, Swift 5.6" + shell: "/bin/zsh {0}" + - xcode: "Xcode_12.4.app" + runsOn: macOS-10.15 + name: "macOS 10.15, Xcode 12.4, Swift 5.3" + shell: "/bin/zsh {0}" + steps: + - uses: actions/checkout@v2 + - name: ${{ matrix.name }} + run: make test_framework_SQLCipher4 + CustomSQLite: + name: Test CustomSQLite + runs-on: ${{ matrix.runsOn }} + timeout-minutes: 40 + strategy: + fail-fast: false + matrix: + include: + - xcode: "Xcode_13.3.1.app" + runsOn: macOS-12 + name: "macOS 12, Xcode 13.3.1, Swift 5.6" + shell: "/bin/zsh {0}" + - xcode: "Xcode_12.4.app" + runsOn: macOS-10.15 + name: "macOS 10.15, Xcode 12.4, Swift 5.3" + shell: "/bin/zsh {0}" + steps: + - uses: actions/checkout@v2 + - name: ${{ matrix.name }} + run: make test_framework_GRDBCustomSQLiteOSX + XCFramework: + name: Test XCFramework + runs-on: ${{ matrix.runsOn }} + timeout-minutes: 20 + strategy: + fail-fast: false + matrix: + include: + - xcode: "Xcode_13.3.1.app" + runsOn: macOS-12 + name: "macOS 12, Xcode 13.3.1, Swift 5.6" + shell: "/bin/zsh {0}" + steps: + - uses: actions/checkout@v2 + - name: ${{ matrix.name }} + run: make test_archive_GRDBOSX_xcframework + \ No newline at end of file From 40b0e98eb5376054e1647c85bf6c574171050fe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 22 May 2022 15:39:08 +0200 Subject: [PATCH 3/8] Delete obsolete Travis setup files --- .ci/gemfiles/Gemfile.travis | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .ci/gemfiles/Gemfile.travis diff --git a/.ci/gemfiles/Gemfile.travis b/.ci/gemfiles/Gemfile.travis deleted file mode 100644 index a9dd99477..000000000 --- a/.ci/gemfiles/Gemfile.travis +++ /dev/null @@ -1,5 +0,0 @@ -source 'https://rubygems.org' - -gem 'xcpretty' -gem 'xcpretty-travis-formatter' -gem 'cocoapods', '~> 1.7' From 758f561fbff6f8c3d427eac99588c6e4fe840e70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 22 May 2022 17:31:45 +0200 Subject: [PATCH 4/8] Raise timeout threshold for SQLCipher CI tests --- Tests/GRDBTests/ValueObservationTests.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/GRDBTests/ValueObservationTests.swift b/Tests/GRDBTests/ValueObservationTests.swift index 8481af673..13848be8d 100644 --- a/Tests/GRDBTests/ValueObservationTests.swift +++ b/Tests/GRDBTests/ValueObservationTests.swift @@ -728,11 +728,11 @@ class ValueObservationTests: GRDBTestCase { }) } - wait(for: [initialValueExpectation], timeout: 1) + wait(for: [initialValueExpectation], timeout: 5) dbWriter.asyncWriteWithoutTransaction { try! $0.execute(sql: "INSERT INTO t DEFAULT VALUES") } - wait(for: [changeExpectation], timeout: 1) + wait(for: [changeExpectation], timeout: 5) // Cleanup for cancellable in cancellables { cancellable.cancel() } From 59bd10b1b5a2ff18ab08f37c3bf21e59c5003f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Sun, 22 May 2022 18:05:13 +0200 Subject: [PATCH 5/8] Raise all CI timeouts --- .github/workflows/CI.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ed9faf403..3c553f046 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -24,7 +24,7 @@ jobs: macOS: name: Test macOS, All Xcodes and Swifts runs-on: ${{ matrix.runsOn }} - timeout-minutes: 20 + timeout-minutes: 40 strategy: fail-fast: false matrix: @@ -60,7 +60,7 @@ jobs: iOS: name: Test iOS runs-on: ${{ matrix.runsOn }} - timeout-minutes: 20 + timeout-minutes: 40 strategy: fail-fast: false matrix: @@ -136,7 +136,7 @@ jobs: XCFramework: name: Test XCFramework runs-on: ${{ matrix.runsOn }} - timeout-minutes: 20 + timeout-minutes: 40 strategy: fail-fast: false matrix: From 63c2bd08761ba405d15e71b689f4c7f869516b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 23 May 2022 08:17:12 +0200 Subject: [PATCH 6/8] Raise SQLCipher CI timeouts --- .github/workflows/CI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3c553f046..8bacc0bda 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -96,7 +96,7 @@ jobs: SQLCipher4: name: Test SQLCipher4 runs-on: ${{ matrix.runsOn }} - timeout-minutes: 40 + timeout-minutes: 60 strategy: fail-fast: false matrix: From 28543109ea67d91757ef0103333e027b495436ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 23 May 2022 08:18:09 +0200 Subject: [PATCH 7/8] Rename CI jobs --- .github/workflows/CI.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8bacc0bda..882e3b76d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -22,7 +22,7 @@ concurrency: cancel-in-progress: true jobs: macOS: - name: Test macOS, All Xcodes and Swifts + name: macOS runs-on: ${{ matrix.runsOn }} timeout-minutes: 40 strategy: @@ -58,7 +58,7 @@ jobs: - name: ${{ matrix.name }} run: make test_framework_GRDBOSX_maxSwift iOS: - name: Test iOS + name: iOS runs-on: ${{ matrix.runsOn }} timeout-minutes: 40 strategy: @@ -78,7 +78,7 @@ jobs: - name: ${{ matrix.name }} run: make test_framework_GRDBiOS_maxTarget_maxSwift SPM: - name: Test SPM + name: SPM runs-on: ${{ matrix.runsOn }} timeout-minutes: 40 strategy: @@ -94,7 +94,7 @@ jobs: - name: ${{ matrix.name }} run: make test_SPM test_install_SPM SQLCipher4: - name: Test SQLCipher4 + name: SQLCipher4 runs-on: ${{ matrix.runsOn }} timeout-minutes: 60 strategy: @@ -114,7 +114,7 @@ jobs: - name: ${{ matrix.name }} run: make test_framework_SQLCipher4 CustomSQLite: - name: Test CustomSQLite + name: CustomSQLite runs-on: ${{ matrix.runsOn }} timeout-minutes: 40 strategy: @@ -134,7 +134,7 @@ jobs: - name: ${{ matrix.name }} run: make test_framework_GRDBCustomSQLiteOSX XCFramework: - name: Test XCFramework + name: XCFramework runs-on: ${{ matrix.runsOn }} timeout-minutes: 40 strategy: From d8f2989542c32b4c1224625d591447aee84061a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gwendal=20Roue=CC=81?= Date: Mon, 23 May 2022 14:11:33 +0200 Subject: [PATCH 8/8] Split SQLCipher clear/encrypted tests --- .github/workflows/CI.yml | 18 ++++- Makefile | 34 +++++++++- .../xcschemes/GRDBEncryptedTests.xcscheme | 68 +++++++++++++++++++ .../xcshareddata/xcschemes/GRDBTests.xcscheme | 24 ------- .../xcschemes/GRDBEncryptedTests.xcscheme | 68 +++++++++++++++++++ .../xcshareddata/xcschemes/GRDBTests.xcscheme | 24 ------- 6 files changed, 185 insertions(+), 51 deletions(-) create mode 100644 Tests/CocoaPods/SQLCipher3/GRDBTests.xcodeproj/xcshareddata/xcschemes/GRDBEncryptedTests.xcscheme create mode 100644 Tests/CocoaPods/SQLCipher4/GRDBTests.xcodeproj/xcshareddata/xcschemes/GRDBEncryptedTests.xcscheme diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 882e3b76d..a3a4fd76d 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -93,6 +93,22 @@ jobs: - uses: actions/checkout@v2 - name: ${{ matrix.name }} run: make test_SPM test_install_SPM + SQLCipher3: + name: SQLCipher3 + runs-on: ${{ matrix.runsOn }} + timeout-minutes: 60 + strategy: + fail-fast: false + matrix: + include: + - xcode: "Xcode_13.3.1.app" + runsOn: macOS-12 + name: "macOS 12, Xcode 13.3.1, Swift 5.6" + shell: "/bin/zsh {0}" + steps: + - uses: actions/checkout@v2 + - name: ${{ matrix.name }} + run: make test_framework_SQLCipher3Encrypted SQLCipher4: name: SQLCipher4 runs-on: ${{ matrix.runsOn }} @@ -112,7 +128,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: ${{ matrix.name }} - run: make test_framework_SQLCipher4 + run: make test_framework_SQLCipher4Encrypted CustomSQLite: name: CustomSQLite runs-on: ${{ matrix.runsOn }} diff --git a/Makefile b/Makefile index c6e89cadb..42bbc411a 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ # make distclean - Restore repository to a pristine state default: test -smokeTest: test_framework_GRDBiOS_maxTarget test_framework_GRDBiOS_minTarget test_framework_SQLCipher4 test_framework_GRDBCustomSQLiteiOS_maxTarget test_SPM +smokeTest: test_framework_GRDBiOS_maxTarget test_framework_GRDBiOS_minTarget test_framework_SQLCipher4Encrypted test_framework_GRDBCustomSQLiteiOS_maxTarget test_SPM # Requirements # ============ @@ -180,7 +180,7 @@ test_framework: test_framework_darwin test_framework_darwin: test_framework_GRDB test_framework_GRDBCustom test_framework_SQLCipher test_SPM test_framework_GRDB: test_framework_GRDBOSX test_framework_GRDBWatchOS test_framework_GRDBiOS test_framework_GRDBtvOS test_framework_GRDBCustom: test_framework_GRDBCustomSQLiteOSX test_framework_GRDBCustomSQLiteiOS -test_framework_SQLCipher: test_framework_SQLCipher3 test_framework_SQLCipher4 +test_framework_SQLCipher: test_framework_SQLCipher3 test_framework_SQLCipher3Encrypted test_framework_SQLCipher4 test_framework_SQLCipher4Encrypted test_archive: test_archive_GRDBOSX_xcframework test_install: test_install_manual test_install_SPM test_install_customSQLite test_install_GRDB_CocoaPods test_CocoaPodsLint test_CocoaPodsLint: test_CocoaPodsLint_GRDB @@ -348,6 +348,21 @@ else @exit 1 endif +test_framework_SQLCipher3Encrypted: +ifdef POD + cd Tests/CocoaPods/SQLCipher3 && \ + $(POD) install && \ + $(XCODEBUILD) \ + -workspace GRDBTests.xcworkspace \ + -scheme GRDBEncryptedTests \ + SWIFT_VERSION=$(MAX_SWIFT_VERSION) \ + build-for-testing test-without-building \ + $(XCPRETTY) +else + @echo CocoaPods must be installed for test_framework_SQLCipher3Encrypted + @exit 1 +endif + test_framework_SQLCipher4: ifdef POD cd Tests/CocoaPods/SQLCipher4 && \ @@ -363,6 +378,21 @@ else @exit 1 endif +test_framework_SQLCipher4Encrypted: +ifdef POD + cd Tests/CocoaPods/SQLCipher4 && \ + $(POD) install && \ + $(XCODEBUILD) \ + -workspace GRDBTests.xcworkspace \ + -scheme GRDBEncryptedTests \ + SWIFT_VERSION=$(MAX_SWIFT_VERSION) \ + build-for-testing test-without-building \ + $(XCPRETTY) +else + @echo CocoaPods must be installed for test_framework_SQLCipher4Encrypted + @exit 1 +endif + test_SPM: # Add sanitizers when available: https://twitter.com/simjp/status/929140877540278272 $(SWIFT) package clean diff --git a/Tests/CocoaPods/SQLCipher3/GRDBTests.xcodeproj/xcshareddata/xcschemes/GRDBEncryptedTests.xcscheme b/Tests/CocoaPods/SQLCipher3/GRDBTests.xcodeproj/xcshareddata/xcschemes/GRDBEncryptedTests.xcscheme new file mode 100644 index 000000000..baa3bab90 --- /dev/null +++ b/Tests/CocoaPods/SQLCipher3/GRDBTests.xcodeproj/xcshareddata/xcschemes/GRDBEncryptedTests.xcscheme @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/CocoaPods/SQLCipher3/GRDBTests.xcodeproj/xcshareddata/xcschemes/GRDBTests.xcscheme b/Tests/CocoaPods/SQLCipher3/GRDBTests.xcodeproj/xcshareddata/xcschemes/GRDBTests.xcscheme index 1efa20217..5485340bb 100644 --- a/Tests/CocoaPods/SQLCipher3/GRDBTests.xcodeproj/xcshareddata/xcschemes/GRDBTests.xcscheme +++ b/Tests/CocoaPods/SQLCipher3/GRDBTests.xcodeproj/xcshareddata/xcschemes/GRDBTests.xcscheme @@ -20,20 +20,6 @@ ReferencedContainer = "container:GRDBTests.xcodeproj"> - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Tests/CocoaPods/SQLCipher4/GRDBTests.xcodeproj/xcshareddata/xcschemes/GRDBTests.xcscheme b/Tests/CocoaPods/SQLCipher4/GRDBTests.xcodeproj/xcshareddata/xcschemes/GRDBTests.xcscheme index 1efa20217..5485340bb 100644 --- a/Tests/CocoaPods/SQLCipher4/GRDBTests.xcodeproj/xcshareddata/xcschemes/GRDBTests.xcscheme +++ b/Tests/CocoaPods/SQLCipher4/GRDBTests.xcodeproj/xcshareddata/xcschemes/GRDBTests.xcscheme @@ -20,20 +20,6 @@ ReferencedContainer = "container:GRDBTests.xcodeproj"> - - - - - - - -