Skip to content

Migrate to Swift 5️⃣.9️⃣ #164

Migrate to Swift 5️⃣.9️⃣

Migrate to Swift 5️⃣.9️⃣ #164

Workflow file for this run

name: CI
on:
push:
branches:
- master
tags:
- '[0-9]+\.[0-9]+\.[0-9]+'
pull_request:
branches:
- master
env:
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md#xcode
DEVELOPER_DIR: "/Applications/Xcode_15.2.app/Contents/Developer"
IOS_DESTINATION: "platform=iOS Simulator,name=iPhone 15 Pro,OS=latest"
jobs:
env-details:
name: Environment details
runs-on: macos-14-arm64
steps:
- name: xcode version
run: xcodebuild -version -sdk
- name: list simulators
run: |
xcrun simctl delete unavailable
xcrun simctl list
build-test:
name: Build and Test
runs-on: macos-14-arm64
env:
WORKSPACE: Alicerce.xcworkspace
SCHEME: Alicerce
DERIVED_DATA_PATH: build
RESULT_BUNDLE_PATH: build-test.xcresult
steps:
- name: git checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
- name: install xcbeautify
run: brew install xcbeautify
- name: unit tests
run: |
set -o pipefail
xcodebuild clean build test \
-workspace "$WORKSPACE" \
-scheme "$SCHEME" \
-destination "$IOS_DESTINATION" \
-derivedDataPath "$DERIVED_DATA_PATH" \
-enableCodeCoverage YES \
-resultBundlePath "$RESULT_BUNDLE_PATH" \
| xcbeautify
- name: codecov upload
uses: codecov/codecov-action@v4
with:
xcode: true
xcode_archive_path: ${{ env.RESULT_BUNDLE_PATH }}
swiftpm:
name: SwiftPM Build
runs-on: macos-14-arm64
env:
WORKSPACE: Alicerce.xcworkspace
SCHEME: "Alicerce (SPM)"
steps:
- name: git checkout
uses: actions/checkout@v3
- name: install xcbeautify
run: brew install xcbeautify
- name: build
run: |
set -o pipefail
xcodebuild clean build \
-workspace "$WORKSPACE" \
-scheme "$SCHEME" \
-destination "$IOS_DESTINATION" \
| xcbeautify
cocoapods:
name: CocoaPods Verification
runs-on: macos-14-arm64
steps:
- name: git checkout
uses: actions/checkout@v3
- name: ruby versions
run: |
ruby --version
gem --version
bundler --version
- name: cache gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gem-
- name: bundle install
run: |
gem install bundler --no-document
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: pod lint
run: bundle exec pod lib lint
carthage:
name: Carthage Verification
runs-on: macos-14-arm64
steps:
- name: git checkout
uses: actions/checkout@v3
- name: carthage build
run: ./script/carthage.sh build --cache-builds --no-skip-current
release-github:
name: GitHub Release
runs-on: macos-14-arm64
needs: [build-test, swiftpm, cocoapods, carthage]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: git checkout
uses: actions/checkout@v3
- name: create release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body: |
# Changes
- <!-- Insert changes here -->
release-cocoapods:
name: CocoaPods Release
runs-on: macos-14-arm64
needs: [build-test, swiftpm, cocoapods, carthage]
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: git checkout
uses: actions/checkout@v3
- name: ruby versions
run: |
ruby --version
gem --version
bundler --version
- name: cache gems
uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gem-
- name: bundle install
run: |
gem install bundler --no-document
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: pod trunk push
env:
COCOAPODS_TRUNK_TOKEN: ${{ secrets.COCOAPODS_TRUNK_TOKEN }}
run: pod trunk push --allow-warnings