Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,7 @@ Then, explain the steps to reproduce the problem from the Test App (https://gith

<!-- Fill in the following information -->

#### Readium versions

<!-- Remove unused modules -->

* `r2-shared-swift`:
* `r2-streamer-swift`:
* `r2-navigator-swift`:
* `r2-opds-swift`:
* `r2-lcp-swift`:
* Readium version:

#### Development environment

Expand Down
132 changes: 132 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
name: Checks

on:
push:
branches: [ main, develop ]
pull_request:

env:
platform: ${{ 'iOS Simulator' }}
device: ${{ 'iPhone 12' }}
# github.sha is the merge commit for a PR event, which fails the Carthage job
# since it doesn't exist.
commit_sha: ${{ github.event.pull_request.head.sha || github.sha }}

jobs:
build:
name: Build
runs-on: macos-latest
env:
scheme: ${{ 'Readium-Package' }}

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: brew install xcodegen
- name: Check Carthage project
run: |
# Check that the Carthage project is up to date.
make carthage-project
git diff --exit-code --name-only PM/Carthage/Readium.xcodeproj
- name: Build
run: |
xcodebuild build-for-testing -scheme "$scheme" -destination "platform=$platform,name=$device"
- name: Test
run: |
xcodebuild test-without-building -scheme "$scheme" -destination "platform=$platform,name=$device"

lint:
name: Lint
runs-on: macos-latest
env:
scripts: ${{ 'Sources/Navigator/EPUB/Scripts' }}

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: yarn --cwd "$scripts" install --frozen-lockfile
- name: Lint JavaScript
run: yarn --cwd "$scripts" run lint
- name: Check JavaScript formatting
run: yarn --cwd "$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

int-spm:
name: Integration (Swift Package Manager)
runs-on: macos-latest
defaults:
run:
working-directory: TestApp
environment: LCP
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: brew install xcodegen
- name: Generate project
run: make spm lcp=${{ secrets.LCP_URL_CARTHAGE }} commit=$commit_sha
- name: Build
run: |
xcodebuild build -scheme TestApp -destination "platform=$platform,name=$device"

int-carthage:
name: Integration (Carthage)
runs-on: macos-latest
defaults:
run:
working-directory: TestApp
environment: LCP
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: brew install xcodegen
- name: Generate project
run: make carthage lcp=${{ secrets.LCP_URL_CARTHAGE }} commit=$commit_sha
- name: Build
run: |
xcodebuild build -scheme TestApp -destination "platform=$platform,name=$device"

# Warning: This 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)
runs-on: macos-latest
defaults:
run:
working-directory: TestApp
environment: LCP
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: brew install xcodegen
- name: Generate project
run: make cocoapods lcp=${{ secrets.LCP_URL_COCOAPODS }} commit=$commit_sha
- name: Build
run: |
xcodebuild build -workspace TestApp.xcworkspace -scheme TestApp -destination "platform=$platform,name=$device"

int-dev:
name: Integration (Local)
runs-on: macos-latest
defaults:
run:
working-directory: TestApp
environment: LCP
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: brew install xcodegen
- name: Generate project
run: make dev lcp=${{ secrets.LCP_URL_CARTHAGE }} commit=$commit_sha
- name: Build
run: |
xcodebuild build -scheme TestApp -destination "platform=$platform,name=$device"

55 changes: 55 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
.DS_Store


# Swift Package Manager
.build/
.swiftpm/
Package.resolved


# Xcode

## User settings
xcuserdata/

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace


# JetBrains AppCode
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

## User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

## Generated files
.idea/**/contentModel.xml

## Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

## File-based project format
*.iws

## IntelliJ
out/

8 changes: 8 additions & 0 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
github "cezheng/Fuzi" ~> 3.1.3
github "dexman/Minizip" ~> 1.4.0
github "krzyzanowskim/CryptoSwift" ~> 1.3.8
github "ra1028/DifferenceKit" ~> 1.2.0
github "readium/GCDWebServer" ~> 3.6.3
github "scinfu/SwiftSoup" ~> 2.3.2
github "stephencelis/SQLite.swift" ~> 0.12.2
github "weichsel/ZIPFoundation" == 0.9.11 # 0.9.12 requires iOS 12+
File renamed without changes.
18 changes: 18 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
SCRIPTS_PATH := Sources/Navigator/EPUB/Scripts

help:
@echo "Usage: make <target>\n\n\
carthage-project\tGenerate the Carthage Xcode project\n\
scripts\t\tBundle the Navigator EPUB scripts\n\
"

.PHONY: carthage-project
carthage-project:
xcodegen -s PM/Carthage/project.yml --use-cache --cache-path PM/Carthage/.xcodegen

.PHONY: scripts
scripts:
yarn --cwd "$(SCRIPTS_PATH)" install --frozen-lockfile
yarn --cwd "$(SCRIPTS_PATH)" run format
yarn --cwd "$(SCRIPTS_PATH)" run lint
yarn --cwd "$(SCRIPTS_PATH)" run bundle
Loading