Skip to content

Commit

Permalink
Rewrite Github Actions (#110)
Browse files Browse the repository at this point in the history
* wip Dependencies.podspec

* fix

* fix podspec

* add linting checks

* bump macos and xcode version

* fix format

* update

* update github actions

* update

* update

* fix typo

* fix

* wip

* update

* update

* update

* fix

* enable cancel in progress

* update

* use ios simulator

* pass value

* fix typo

* update

* update

* add concurrency extras

* update

* pinned ConcurrencyExtra to 1.0.0

* change source url

* change source

* set version

* update

* remove

* revert

* revert

* revert
  • Loading branch information
wendyliga authored Jan 15, 2024
1 parent 0f3be75 commit a347bfa
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 44 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Base

on:
workflow_call:
inputs:
os:
description: 'The OS to run the job on'
required: true
type: string
xcode:
description: 'The Xcode version to run the job on'
required: true
type: string
device:
description: 'The device to run the job on'
required: true
type: string

jobs:

build_library:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v3
- name: Select Xcode ${{ inputs.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode }}.app
- name: Run build
run: make build-library
- name: Run benchmark
run: make benchmark

unit_test_library:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v3
- name: Select Xcode ${{ inputs.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode }}.app
- name: Run tests
run: make test-library

unit_test_example:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v3
- name: Select Xcode ${{ inputs.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode }}.app
- name: Run tests
run: make test-example DEVICE='${{ inputs.device }}'

lint_podspec:
runs-on: ${{ inputs.os }}
steps:
- uses: actions/checkout@v3
- name: Select Xcode ${{ inputs.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ inputs.xcode }}.app
- name: Install cocoapods
run: sudo gem install cocoapods
- name: Lint podspec
run: pod lib lint --allow-warnings --quick




59 changes: 18 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,47 +8,24 @@ on:
branches:
- '*'

jobs:

build_library:
strategy:
matrix:
xcode:
- '13.4.1'
- '14.1'
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: Run build
run: make build-library
- name: Run benchmark
run: make benchmark
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

unit_test_library:
jobs:
ci:
strategy:
fail-fast: false
matrix:
xcode:
- '13.4.1'
- '14.1'
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: Run tests
run: make test-library

unit_test_example:
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- name: Selext Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_14.1.app
- name: Run tests
run: make test-example




include:
- os: macos-13
xcode: '15.0.1'
device: 'iPhone 15'
- os: macos-13
xcode: '14.3.1'
device: 'iPhone 14'
uses: ./.github/workflows/base.yml
with:
os: ${{ matrix.os }}
xcode: ${{ matrix.xcode }}
device: ${{ matrix.device }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/.build
/Packages
/*.xcodeproj
/*.vscode
xcuserdata/
DerivedData/
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test-example:
xcodebuild test \
-project Examples.xcodeproj \
-scheme Examples \
-destination "platform=iOS Simulator,name=iPhone 13 Pro Max"
-destination "platform=iOS Simulator,name=$(DEVICE)"
-derivedDataPath ../derivedData \
| xcpretty \
&& rm -rf ../derivedData
Expand Down
4 changes: 2 additions & 2 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"repositoryURL": "https://github.com/pointfreeco/swift-custom-dump",
"state": {
"branch": null,
"revision": "0dd3e712ff2e557144dddced800c517c3102a069",
"version": "0.9.0"
"revision": "4a87bb75be70c983a9548597e8783236feb3401e",
"version": "0.11.1"
}
},
{
Expand Down

0 comments on commit a347bfa

Please sign in to comment.