Skip to content

Commit

Permalink
ci: fix ci script
Browse files Browse the repository at this point in the history
  • Loading branch information
OhKanghoon committed Jun 19, 2022
1 parent fa2beb2 commit a5099a0
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 47 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ jobs:
build:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v1

- name: Generate Xcode Project
run: swift package generate-xcodeproj
- name: Generate Xcode Project
run: swift package generate-xcodeproj

- name: Carthage Build
run: carthage build --no-skip-current --platform $CARTHAGE_PLATFORMS
- name: Carthage Build
run: carthage build --no-skip-current --platform $CARTHAGE_PLATFORMS

- name: Carthage Archive
run: carthage archive $CARTHAGE_FRAMEWORKS
- name: Carthage Archive
run: carthage archive $CARTHAGE_FRAMEWORKS

- name: Upload Carthage Framework
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.CARTHAGE_FRAMEWORK_NAME }}
asset_name: ${{ env.CARTHAGE_FRAMEWORK_NAME }}
asset_content_type: application/zip
- name: Upload Carthage Framework
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.CARTHAGE_FRAMEWORK_NAME }}
asset_name: ${{ env.CARTHAGE_FRAMEWORK_NAME }}
asset_content_type: application/zip
61 changes: 30 additions & 31 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ jobs:
test:
runs-on: macOS-latest
env:
PROJECT: URLNavigator.xcodeproj
SCHEME: URLNavigator-Package
CODECOV_PACKAGE_NAME: URLNavigator
strategy:
matrix:
env:
- sdk: iphonesimulator
destination: platform=iOS Simulator,name=iPhone 11 Pro,OS=latest
destination: platform=iOS Simulator,name=iPhone 13 Pro,OS=latest

- sdk: macosx
destination: arch=x86_64
Expand All @@ -24,32 +23,32 @@ jobs:
destination: platform=tvOS Simulator,name=Apple TV,OS=latest

steps:
- uses: actions/checkout@v1

- name: List SDKs and Devices
run: xcodebuild -showsdks; instruments -s

- name: Generate Xcode Project
run: swift package generate-xcodeproj --enable-code-coverage

- name: Build and Test
run: |
set -o pipefail && xcodebuild clean build test \
-project "$PROJECT" \
-scheme "$SCHEME" \
-sdk "$SDK" \
-destination "$DESTINATION" \
-configuration Debug \
-enableCodeCoverage YES \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty -c;
env:
SDK: ${{ matrix.env.sdk }}
DESTINATION: ${{ matrix.env.destination }}

- name: Upload Code Coverage
run: |
bash <(curl -s https://codecov.io/bash) \
-X xcodeplist \
-J "$CODECOV_PACKAGE_NAME"
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- uses: actions/checkout@v3

- name: List SDKs and Devices
run: xcodebuild -showsdks; xcrun xctrace list devices

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest

- name: Build and Test
run: |
set -o pipefail && xcodebuild clean build test \
-scheme "$SCHEME" \
-sdk "$SDK" \
-destination "$DESTINATION" \
-configuration Debug \
-enableCodeCoverage YES \
CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO | xcpretty -c;
env:
SDK: ${{ matrix.env.sdk }}
DESTINATION: ${{ matrix.env.destination }}

- name: Upload Code Coverage
run: |
bash <(curl -s https://codecov.io/bash) \
-X xcodeplist \
-J "$CODECOV_PACKAGE_NAME"
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit a5099a0

Please sign in to comment.