Add CI workflow with code linting and automated build checks #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- '.gitignore' | |
- 'LICENSE' | |
- 'README.md' | |
- 'resources/**' | |
pull_request: | |
paths-ignore: | |
- '.gitignore' | |
- 'LICENSE' | |
- 'README.md' | |
- 'resources/**' | |
workflow_dispatch: | |
concurrency: | |
group: ci-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: Lint | |
runs-on: macos-14 | |
env: | |
DEVELOPER_DIR: "/Applications/Xcode_16.1.app/Contents/Developer" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install swift-format | |
run: brew install swift-format | |
- name: Lint Code | |
run: make lint | |
build: | |
name: Build (Xcode ${{ matrix.xcode }}) | |
needs: [lint] | |
runs-on: macos-${{ matrix.macos }} | |
env: | |
DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" | |
strategy: | |
matrix: | |
include: | |
- macos: 14 | |
xcode: '15.4' # Swift 5.10 | |
- macos: 15 | |
xcode: '16.1' # Swift 6.0 | |
steps: | |
- name: Runner Overview | |
run: system_profiler SPHardwareDataType SPSoftwareDataType SPDeveloperToolsDataType | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install swift-format | |
run: brew install swift-format | |
- name: Disable package plugin validation | |
run: defaults write com.apple.dt.Xcode IDESkipPackagePluginFingerprintValidatation -bool YES | |
- name: Build Project | |
run: | | |
xcodebuild clean build \ | |
-project FingerprintProDemo.xcodeproj \ | |
-scheme FingerprintProDemo \ | |
CODE_SIGNING_ALLOWED=NO \ | |
| xcbeautify |