Skip to content

Commit

Permalink
Run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentTreguier committed Aug 1, 2024
1 parent 5f56791 commit 0d958b5
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 10 deletions.
56 changes: 51 additions & 5 deletions .github/workflows/publishing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ jobs:
- name: Prepare files
if: ${{ matrix.distribution == 'app-store' }}
env:
CODE_SIGN_IDENTITY: 'Apple Distribution'
DEVELOPMENT_TEAM: ${{ vars.TEAM_ID }}
CODE_SIGN_IDENTITY: Apple Distribution
PROVISIONING_PROFILE_SPECIFIER: ${{ matrix.platform == 'macOS' && vars.PROVISIONING_PROFILE_NAME_MACOS || vars.PROVISIONING_PROFILE_NAME }}
SENTRY_DSN: ${{ matrix.platform == 'iOS' && secrets.SENTRY_DSN_IOS || secrets.SENTRY_DSN_MACOS }}
SENTRY_ORG: ${{ vars.SENTRY_ORG }}
Expand All @@ -100,7 +101,8 @@ jobs:
- name: Prepare files
if: ${{ matrix.distribution == 'standalone' }}
env:
CODE_SIGN_IDENTITY: 'Developer ID Application'
DEVELOPMENT_TEAM: ${{ vars.TEAM_ID }}
CODE_SIGN_IDENTITY: Developer ID Application
PROVISIONING_PROFILE_SPECIFIER: ${{ vars.PROVISIONING_PROFILE_NAME_MACOS_STANDALONE }}
run: make

Expand All @@ -114,10 +116,9 @@ jobs:
- name: Build app
env:
CODE_SIGN_IDENTITY: Apple Distribution
PROVISIONING_PROFILE_SPECIFIER: Fyreplace
PROVISIONING_PROFILE_SPECIFIER: ${{ vars.PROVISIONING_PROFILE_NAME }}
run: |
xcodebuild archive \
DEVELOPMENT_TEAM=${{ vars.TEAM_ID }} \
-allowProvisioningUpdates \
-authenticationKeyPath /tmp/connect-key.p8 \
-authenticationKeyID ${{ vars.APP_STORE_CONNECT_KEY_ID }} \
Expand Down Expand Up @@ -176,9 +177,54 @@ jobs:
path: Export/Fyreplace.pkg
if-no-files-found: error

test:
name: Test
runs-on: macos-latest
environment: apple-app-store
strategy:
matrix:
platform:
- iOS
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true

- name: Cache packages
uses: actions/cache@v4
with:
path: |
~/Library/Caches/org.swift.swiftpm
~/Library/Developer/Xcode/DerivedData/**/SourcePackages/checkouts
~/Library/Developer/Xcode/DerivedData/**/SourcePackages/repositories
key: ${{ runner.os }}-${{ matrix.platform }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-${{ matrix.platform }}-spm-
- name: Select Xcode version
run: sudo xcode-select -s /Applications/Xcode_$(cat .xcode-version).app/Contents/Developer

- name: Prepare files
run: make

- name: Trust OpenAPI plugin
run: bash .github/workflows/trust-openapi-plugin.sh

- name: Run tests
run: |
xcodebuild test \
CODE_SIGNING_ALLOWED=no \
-scheme Fyreplace \
-destination platform=${{ matrix.platform }},OS=$(cat .ios-test-version) \
-only-testing FyreplaceTests
publish:
name: Publish
needs: build
needs:
- build
- test
runs-on: macos-latest
environment: apple-app-store
strategy:
Expand Down
1 change: 1 addition & 0 deletions .ios-test-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
17.5
9 changes: 4 additions & 5 deletions Fyreplace.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
4D54C96C2BF4E9BE001DE071 /* ArchiveScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ArchiveScreen.swift; sourceTree = "<group>"; };
4D54C96E2BF4E9DF001DE071 /* DraftsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DraftsScreen.swift; sourceTree = "<group>"; };
4D54C9702BF4EA15001DE071 /* SettingsScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsScreen.swift; sourceTree = "<group>"; };
4D6641DB2C5B963500BE3D07 /* .ios-test-version */ = {isa = PBXFileReference; lastKnownFileType = text; path = ".ios-test-version"; sourceTree = "<group>"; };
4D7F9CC12C259C00007B1CC3 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
4D9B3B372C334B3A00A8F7AD /* LoginScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginScreen.swift; sourceTree = "<group>"; };
4D9B3B392C334B6300A8F7AD /* RegisterScreen.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterScreen.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -228,6 +229,7 @@
4D54C9462BF26090001DE071 /* FyreplaceUITests */,
4D54C9632BF28695001DE071 /* .gitignore */,
4D0DDC292C18A467006CD503 /* .xcode-version */,
4D6641DB2C5B963500BE3D07 /* .ios-test-version */,
4DCEF8652C452EBA00F53085 /* .env-example */,
4DCEF8662C452ECC00F53085 /* .env */,
4D54C9592BF266F9001DE071 /* Makefile */,
Expand Down Expand Up @@ -682,7 +684,6 @@
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -857,7 +858,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
DEAD_CODE_STRIPPING = YES;
CODE_SIGN_IDENTITY = "-";
GENERATE_INFOPLIST_FILE = YES;
PRODUCT_BUNDLE_IDENTIFIER = app.fyreplace.FyreplaceTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -875,7 +876,6 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
BUNDLE_LOADER = "$(TEST_HOST)";
DEAD_CODE_STRIPPING = YES;
GENERATE_INFOPLIST_FILE = YES;
PRODUCT_BUNDLE_IDENTIFIER = app.fyreplace.FyreplaceTests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -892,7 +892,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
DEAD_CODE_STRIPPING = YES;
CODE_SIGN_IDENTITY = "-";
GENERATE_INFOPLIST_FILE = YES;
PRODUCT_BUNDLE_IDENTIFIER = app.fyreplace.FyreplaceUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -909,7 +909,6 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
DEAD_CODE_STRIPPING = YES;
GENERATE_INFOPLIST_FILE = YES;
PRODUCT_BUNDLE_IDENTIFIER = app.fyreplace.FyreplaceUITests;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down

0 comments on commit 0d958b5

Please sign in to comment.