Fix potential race condition in the EPUB navigator #1188
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: | |
| 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 Carthage project | |
| run: | | |
| # Check that the Carthage project is up to date. | |
| make carthage-project | |
| git diff --exit-code Support/Carthage/Readium.xcodeproj | |
| - 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 | |
| # 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 | |
| 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 | |
| int-carthage: | |
| name: Integration (Carthage) | |
| runs-on: macos-15 | |
| if: ${{ !github.event.pull_request.draft && github.ref == 'refs/heads/main' }} | |
| 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 Carthage. | |
| - 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 carthage lcp=${{ secrets.LCP_URL_CARTHAGE }} 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 | |