diff --git a/.github/workflows/pull-request-ci.yml b/.github/workflows/pull-request-ci.yml new file mode 100644 index 0000000..7ba1c66 --- /dev/null +++ b/.github/workflows/pull-request-ci.yml @@ -0,0 +1,62 @@ +name: Pull Request CI + +on: + pull_request: + workflow_dispatch: + +concurrency: + group: pull-request-ci-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + unit-tests: + name: Unit Tests (${{ matrix.scheme }}) + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + scheme: + - libPhoneNumber + - libPhoneNumberGeocoding + - libPhoneNumberShortNumber + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Run unit tests + env: + SCHEME: ${{ matrix.scheme }} + run: | + set -eo pipefail + + xcodebuild \ + -project libPhoneNumber.xcodeproj \ + -scheme "$SCHEME" \ + -destination 'platform=iOS Simulator,OS=latest,name=iPhone 17' \ + CODE_SIGNING_ALLOWED=NO \ + test + + podspec-lint: + name: Podspec Lint (${{ matrix.podspec }}) + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + podspec: + - libPhoneNumber-iOS.podspec + - libPhoneNumberGeocoding.podspec + - libPhoneNumberShortNumber.podspec + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Ensure CocoaPods is installed + run: | + if ! command -v pod >/dev/null; then + gem install cocoapods + fi + + - name: Lint podspec + run: pod lib lint "${{ matrix.podspec }}" --verbose