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 修復 #90

Merged
merged 3 commits into from
Jan 8, 2025
Merged
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
28 changes: 7 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,32 @@ name: Test

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

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
setup:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.setmatrix.outputs.matrix }}
steps:
- id: setmatrix
run: |
object="[{\"scheme\":\"YumemiWeather\",\"dir\":\".\"},{\"scheme\":\"Example\",\"dir\":\"Example\"}]"
echo "matrix=$object" >> $GITHUB_OUTPUT
test:
needs: setup
build:
runs-on: macos-latest
permissions:
contents: read
checks: write
strategy:
matrix:
config: ${{fromJson(needs.setup.outputs.matrix)}}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test
env:
scheme: ${{ 'YumemiWeather' }}
platform: ${{ 'iOS Simulator' }}
run: |
# xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959)
device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"`
cd ${{ matrix.config.dir }}
rm -rf "${{ matrix.config.scheme }}".xcresult
xcodebuild -scheme "${{ matrix.config.scheme }}" -resultBundlePath "${{ matrix.config.scheme }}".xcresult test -destination "platform=$platform,name=$device"
- name: Report
xcodebuild -scheme "$scheme" -resultBundlePath TestResults test -destination "platform=$platform,name=$device"
- name: Format
uses: kishikawakatsumi/xcresulttool@v1
with:
path: ${{ matrix.config.scheme }}.xcresult
path: TestResults.xcresult
if: success() || failure()
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
xcuserdata/
DerivedData/
docs
/Example.xcresult

# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
.swiftpm
.swiftpm
Loading