Replace AnyHashable #1580
Workflow file for this run
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: Checks | |
| on: | |
| push: | |
| branches: [ main, develop ] | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| platform: ${{ 'iOS Simulator' }} | |
| device: ${{ 'iPhone 16 Pro' }} | |
| commit_sha: ${{ github.sha }} | |
| DEVELOPER_DIR: /Applications/Xcode_16.4.app/Contents/Developer | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: macos-15 | |
| if: ${{ !github.event.pull_request.draft }} | |
| env: | |
| scheme: ${{ 'Readium-Package' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Install dependencies | |
| run: | | |
| brew update | |
| brew install xcodegen | |
| # Preload the list of simulator for xcodebuild. The workflow is flaky without it. | |
| xcrun simctl list | |
| - name: Check CocoaPods podspecs | |
| run: | | |
| # Check that the podspecs are up to date. | |
| make podspecs | |
| git diff --exit-code Support/CocoaPods/ | |
| if git ls-files --others --exclude-standard Support/CocoaPods/ | grep -q .; then echo "Untracked podspec files found. Run 'make podspecs' and commit the result."; exit 1; fi | |
| - name: Build | |
| run: | | |
| set -eo pipefail | |
| xcodebuild build-for-testing -scheme "$scheme" -destination "platform=$platform,name=$device" | if command -v xcpretty &> /dev/null; then xcpretty; else cat; fi | |
| - name: Test | |
| run: | | |
| set -eo pipefail | |
| xcodebuild test-without-building -scheme "$scheme" -destination "platform=$platform,name=$device" | if command -v xcpretty &> /dev/null; then xcpretty; else cat; fi | |
| - name: Print Swift package versions | |
| run: | | |
| jq -r '.pins[] | "\(.identity): \(.state.version)"' Package.resolved | |
| # navigator-ui-tests: | |
| # name: Navigator UI Tests | |
| # runs-on: macos-15 | |
| # if: ${{ !github.event.pull_request.draft }} | |
| # steps: | |
| # - name: Checkout | |
| # uses: actions/checkout@v3 | |
| # - name: Install dependencies | |
| # run: | | |
| # brew update | |
| # brew install xcodegen | |
| # # Preload the list of simulator for xcodebuild. The workflow is flaky without it. | |
| # xcrun simctl list | |
| # - name: Test | |
| # run: | | |
| # set -eo pipefail | |
| # make navigator-ui-tests-project | |
| # xcodebuild test -project Tests/NavigatorTests/UITests/NavigatorUITests.xcodeproj -scheme NavigatorTestHost -destination "platform=$platform,name=$device" | if command -v xcpretty &> /dev/null; then xcpretty; else cat; fi | |
| playground: | |
| name: Playground | |
| runs-on: macos-15 | |
| if: ${{ !github.event.pull_request.draft }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Install dependencies | |
| run: | | |
| brew update | |
| brew install xcodegen | |
| # Preload the list of simulator for xcodebuild. The workflow is flaky without it. | |
| xcrun simctl list | |
| - name: Check Playground project is up-to-date | |
| run: | | |
| make playground | |
| git diff --exit-code Playground/.xcodegen | |
| - name: Build | |
| run: | | |
| set -eo pipefail | |
| xcodebuild build -scheme Playground -project Playground/Playground.xcodeproj -destination "platform=$platform,name=$device" | if command -v xcpretty &> /dev/null; then xcpretty; else cat; fi | |
| lint: | |
| name: Lint | |
| runs-on: macos-15 | |
| if: ${{ !github.event.pull_request.draft }} | |
| env: | |
| scripts: ${{ 'Sources/Navigator/EPUB/Scripts' }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| package_json_file: Sources/Navigator/EPUB/Scripts/package.json | |
| run_install: false | |
| - name: Setup cache | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| cache: 'pnpm' | |
| cache-dependency-path: Sources/Navigator/EPUB/Scripts/pnpm-lock.yaml | |
| - name: Install dependencies | |
| run: pnpm --dir "$scripts" install --frozen-lockfile | |
| - name: Lint | |
| run: pnpm --dir "$scripts" run lint | |
| - name: Check formatting | |
| run: pnpm --dir "$scripts" run checkformat | |
| - name: Check if bundled scripts are up-to-date | |
| run: | | |
| make scripts | |
| git diff --exit-code --name-only Sources/Navigator/EPUB/Assets/Static/scripts/*.js | |
| - name: Lint Swift formatting | |
| run: make lint-format | |
| int-dev: | |
| name: Integration (Local) | |
| runs-on: macos-15 | |
| if: ${{ !github.event.pull_request.draft }} | |
| defaults: | |
| run: | |
| working-directory: TestApp | |
| environment: LCP | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Install dependencies | |
| run: | | |
| brew update | |
| brew install xcodegen | |
| # Preload the list of simulator for xcodebuild. The workflow is flaky without it. | |
| xcrun simctl list | |
| - name: Generate project | |
| run: make dev lcp=${{ secrets.LCP_URL_SPM }} | |
| - name: Build | |
| run: | | |
| set -eo pipefail | |
| xcodebuild build -scheme TestApp -destination "platform=$platform,name=$device" | if command -v xcpretty &> /dev/null; then xcpretty; else cat; fi | |
| int-spm: | |
| name: Integration (Swift Package Manager) | |
| runs-on: macos-15 | |
| if: ${{ !github.event.pull_request.draft }} | |
| defaults: | |
| run: | |
| working-directory: TestApp | |
| environment: LCP | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| # We can't use the current github.sha with pull_request event, because they will | |
| # reference the merge commit which cannot be fetched with SPM. | |
| - name: Set commit SHA | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| echo "commit_sha=${{ github.event.pull_request.head.sha }}" >> "$GITHUB_ENV" | |
| - name: Install dependencies | |
| run: | | |
| brew update | |
| brew install xcodegen | |
| # Preload the list of simulator for xcodebuild. The workflow is flaky without it. | |
| xcrun simctl list | |
| - name: Generate project | |
| run: make spm lcp=${{ secrets.LCP_URL_SPM }} commit=$commit_sha | |
| - name: Build | |
| run: | | |
| set -eo pipefail | |
| xcodebuild build -scheme TestApp -destination "platform=$platform,name=$device" | if command -v xcpretty &> /dev/null; then xcpretty; else cat; fi | |