Skip to content

Documentation for the v3 #753

Documentation for the v3

Documentation for the v3 #753

Workflow file for this run

name: Checks
on:
push:
branches: [ main, develop ]
pull_request:
env:
platform: ${{ 'iOS Simulator' }}
device: ${{ 'iPhone 15' }}
commit_sha: ${{ github.sha }}
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
jobs:
build:
name: Build
runs-on: macos-14
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
- 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
lint:
name: Lint
runs-on: macos-14
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-14
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
- 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-14
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
- 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-14
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 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
- 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
# Warning: This job cannot actually test the state of the current commit,
# but will check that the latest branch/tag set in the Podspecs are valid.
int-cocoapods:
name: Integration (CocoaPods)
if: github.event_name == 'push'
runs-on: macos-14
defaults:
run:
working-directory: TestApp
environment: LCP
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install dependencies
run: |
brew update
brew install xcodegen
- name: Generate project
run: make cocoapods lcp=${{ secrets.LCP_URL_COCOAPODS }} commit=$commit_sha
- name: Build
run: |
set -eo pipefail
xcodebuild build -workspace TestApp.xcworkspace -scheme TestApp -destination "platform=$platform,name=$device" | if command -v xcpretty &> /dev/null; then xcpretty; else cat; fi