Merge pull request #102 from hamcrest/dependabot/github_actions/actio… #197
This file contains hidden or 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: Build | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| project: OCHamcrest.xcodeproj | |
| jobs: | |
| build: | |
| name: Build without tests | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| run-config: | |
| - { scheme: 'OCHamcrest', sdk: 'iphonesimulator', destination: 'platform=iOS Simulator,OS=latest,name=iPhone 16' } | |
| - { scheme: 'OCHamcrest', sdk: 'appletvsimulator', destination: 'platform=tvOS Simulator,OS=latest,name=Apple TV' } | |
| - { scheme: 'OCHamcrest', sdk: 'watchsimulator', destination: 'platform=watchOS Simulator,OS=latest,name=Apple Watch Series 10 (46mm)' } | |
| - { scheme: 'OCHamcrest', sdk: 'xrsimulator', destination: 'platform=visionOS Simulator,OS=latest,name=Apple Vision Pro' } | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Show current version of Xcode | |
| run: xcodebuild -version | |
| - name: Build | |
| run: set -o pipefail && xcodebuild build -project '${{ env.project }}' -scheme '${{ matrix.run-config['scheme'] }}' -sdk '${{ matrix.run-config['sdk'] }}' -destination '${{ matrix.run-config['destination'] }}' CODE_SIGNING_ALLOWED='NO' | xcbeautify | |
| test: | |
| name: Build, test, report coverage | |
| runs-on: macos-latest | |
| env: | |
| scheme: OCHamcrest | |
| sdk: macosx | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Show current version of Xcode | |
| run: xcodebuild -version | |
| - name: Build & test | |
| run: set -o pipefail && xcodebuild test -project '${{ env.project }}' -scheme '${{ env.scheme }}' -sdk '${{ env.sdk }}' CODE_SIGNING_ALLOWED='NO' | xcbeautify | |
| - name: Install gems | |
| run: | | |
| bundle config path vendor/bundle | |
| bundle config set --local without 'documentation' | |
| bundle install --jobs 4 --retry 3 | |
| - name: Extract branch name | |
| shell: bash | |
| run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT | |
| id: get_branch | |
| - name: Report coverage | |
| run: bundle exec slather | |
| env: | |
| GIT_BRANCH: ${{ steps.get_branch.outputs.branch }} | |
| CI_PULL_REQUEST: ${{ github.event.number }} | |
| COVERAGE_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| buildSwiftPackage: | |
| needs: [ build, test ] | |
| name: Build & Test Swift package | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Build & test | |
| run: swift test | xcbeautify | |
| buildCarthage: | |
| needs: [ build, test ] | |
| name: Build Carthage | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Show current version of Xcode | |
| run: xcodebuild -version | |
| - name: Show current version of Carthage | |
| run: carthage version | |
| - name: Build | |
| run: carthage build --configuration Release --no-skip-current --use-xcframeworks | |
| podspec: | |
| needs: [ build, test ] | |
| name: Pod Spec Lint | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Show current version of CocoaPods | |
| run: pod --version | |
| - name: Lint the pod spec | |
| run: pod spec lint --quick | |
| auto-merge: | |
| needs: [ buildSwiftPackage, buildCarthage, podspec ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: auto-merge | |
| if: | | |
| github.actor == 'dependabot[bot]' && | |
| github.event_name == 'pull_request' | |
| run: | | |
| ./merge_dependabot.sh | |
| env: | |
| PR_URL: ${{github.event.pull_request.html_url}} | |
| # this secret needs to be in the settings.secrets.dependabot | |
| GITHUB_TOKEN: ${{secrets.GH_ACTION_TOKEN}} |