Skip to content

Commit

Permalink
Run tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentTreguier committed Jul 31, 2024
1 parent 5f56791 commit 82344e4
Showing 1 changed file with 68 additions and 5 deletions.
73 changes: 68 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,71 @@ jobs:
path: Export/Fyreplace.pkg
if-no-files-found: error

test:
name: Test
runs-on: macos-latest
environment: apple-app-store
strategy:
matrix:
platform:
- macOS
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: Set up signing certificate
env:
CERTIFICATE_DISTRIBUTION_B64: ${{ vars.CERTIFICATE_DISTRIBUTION_B64 }}
CERTIFICATE_DISTRIBUTION_PRIVATE_KEY_B64: ${{ secrets.CERTIFICATE_DISTRIBUTION_PRIVATE_KEY_B64 }}
run: |
security create-keychain -p password build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p password build.keychain
security set-keychain-settings build.keychain
echo $CERTIFICATE_DISTRIBUTION_B64 | base64 --decode > /tmp/certificate.cer
security import /tmp/certificate.cer -k build.keychain -P '' -T /usr/bin/codesign -T /usr/bin/productsign
echo $CERTIFICATE_DISTRIBUTION_PRIVATE_KEY_B64 | base64 --decode > /tmp/key.p12
security import /tmp/key.p12 -k build.keychain -P '' -T /usr/bin/codesign -T /usr/bin/productsign
security set-key-partition-list -S apple-tool:,apple: -s -k password build.keychain
- name: Select Xcode version
run: sudo xcode-select -s /Applications/Xcode_$(cat .xcode-version).app/Contents/Developer

- name: Prepare files
env:
DEVELOPMENT_TEAM: ${{ vars.TEAM_ID }}
CODE_SIGN_IDENTITY: Apple Distribution
PROVISIONING_PROFILE_SPECIFIER: ${{ vars.PROVISIONING_PROFILE_NAME }}
run: make

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

- name: Run tests
run: |
xcodebuild test \
-scheme Fyreplace \
-only-testing FyreplaceTests
publish:
name: Publish
needs: build
needs:
- build
- test
runs-on: macos-latest
environment: apple-app-store
strategy:
Expand Down

0 comments on commit 82344e4

Please sign in to comment.