Maintenance for example apps (#83) #240
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
# https://github.com/actions/virtual-environments | |
name: test | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
env: | |
DEVELOPER_DIR: /Applications/Xcode_14.3.1.app | |
jobs: | |
test: | |
name: Test | |
runs-on: macos-13 | |
strategy: | |
matrix: | |
platform: | |
- ios | |
- macos | |
- tvos | |
- watchos | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Test library | |
run: scripts/test.sh library ${{ matrix.platform }} | |
- name: Test example cross platform | |
if: matrix.platform == 'macos' || matrix.platform == 'tvos' | |
run: scripts/test.sh example-cross-platform ${{ matrix.platform }} | |
test_examples: | |
name: Test iOS examples | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Test example iOS | |
run: scripts/test.sh example-ios ios | |
validation: | |
name: Validation | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Show environments | |
run: | | |
swift --version | |
xcodebuild -version | |
- uses: actions/cache@v3 | |
with: | |
path: bin | |
key: spm-${{ runner.os }}-${{env.DEVELOPER_DIR}}-${{ hashFiles('Package.swift') }}-${{ github.job }} | |
- name: Validate lint | |
run: make lint | |
- name: Validate format | |
run: | | |
make format | |
if [ -n "$(git status --porcelain)" ]; then echo "Make sure that the code is formated by 'make format'."; exit 1; fi | |
- name: Validate example project | |
run: | | |
make proj | |
if [ -n "$(git status --porcelain)" ]; then echo "Make sure that 'Examples/App.xcodeproj' is formated by 'make proj'."; exit 1; fi |