YMFF/.github/workflows/Common.yml

57 lines
1.5 KiB
YAML

name: Common Checks
on:
pull_request:
push:
branches:
- "main"
workflow_call:
inputs:
force_all_checks:
type: boolean
required: true
workflow_dispatch:
env:
XCODE_PATH: "/Applications/Xcode_14.1.app"
jobs:
spm_tests_macos:
name: SPM Tests (Swift ${{ matrix.SWIFT_VERSION }} on macOS)
runs-on: ${{ matrix.OS }}
strategy:
matrix:
SWIFT_VERSION: ["5.7", "5.5"]
include:
- SWIFT_VERSION: "5.7"
OS: macOS-12
XCODE_APP_NAME: "Xcode_14.1"
- SWIFT_VERSION: "5.5"
OS: macOS-12
XCODE_APP_NAME: "Xcode_13.2.1"
steps:
- uses: actions/checkout@v3
- name: Select Xcode Version
run: sudo xcode-select -switch "/Applications/${{ matrix.XCODE_APP_NAME }}.app"
- name: Run Tests
run: |
swift --version
swift test -v
spm_tests_linux:
name: SPM Tests (Linux)
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Run Tests
run: |
swift --version
swift test -v
cocoapods_podspec_lint:
name: CocoaPods Podspec Linting
runs-on: macOS-12
if: ${{ inputs.force_all_checks || github.event_name == 'pull_request' }}
needs: [spm_tests_macos, spm_tests_linux]
steps:
- uses: actions/checkout@v3
- name: Select Xcode Version
run: sudo xcode-select -switch ${{ env.XCODE_PATH }}
- name: Lint Podspec
run: pod lib lint --verbose