Skip to content
Draft
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches: [ main, develop ]
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -128,25 +129,27 @@ jobs:
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
if git ls-files --others --exclude-standard Playground/Playground.xcodeproj/ | grep -q .; then echo "Untracked Playground project files found. Run 'make playground' and commit the result."; exit 1; fi
- name: Build Playground
- name: Cache DerivedData
uses: actions/cache@v6
with:
path: .derivedData
key: ${{ runner.os }}-derived-data-${{ hashFiles('Package.swift') }}
restore-keys: |
${{ runner.os }}-derived-data-
- name: Generate Playground project
run: make playground lcp=${{ secrets.LCP_URL_SPM }}
- name: Test Playground (LCP only)
run: |
set -eo pipefail
xcodebuild build -scheme Playground -project Playground/Playground.xcodeproj -destination "platform=$platform,name=$device" | xcbeautify --renderer github-actions
xcodebuild test -scheme Playground -project Playground/Playground.xcodeproj -destination "platform=$platform,name=$device" -only-testing:ReadiumLCPTests -derivedDataPath .derivedData | xcbeautify --renderer github-actions
- name: Generate TestApp project
run: make dev lcp=${{ secrets.LCP_URL_SPM }}
working-directory: TestApp
env:
LCP_URL_SPM: ${{ secrets.LCP_URL_SPM }}
run: make dev lcp="$LCP_URL_SPM"
- name: Build TestApp
working-directory: TestApp
run: |
set -eo pipefail
xcodebuild build -scheme TestApp -destination "platform=$platform,name=$device" | xcbeautify --renderer github-actions
xcodebuild build -scheme TestApp -destination "platform=$platform,name=$device" -derivedDataPath ../.derivedData | xcbeautify --renderer github-actions
working-directory: TestApp

int-spm:
name: Integration (Swift Package Manager)
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ out/
# DocC generation
.build-docs
docs-site
WorkspaceSettings.xcsettings
13 changes: 9 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,21 @@ help:

.PHONY: test
test:
xcodebuild test -project "TestApp/TestApp.xcodeproj" -scheme TestApp -destination "platform=iOS Simulator,name=iPhone Air" 2> /dev/null \
xcodebuild test -scheme Readium-Package -destination "platform=iOS Simulator,name=iPhone Air" 2> /dev/null \
| xcbeautify --quieter --disable-logging \
| grep -Ev "^Executed |Test Suite 'All tests'|Test run started\.|Test session results:"; true

.SILENT:
.PHONY: playground
playground:
cd Playground; \
find . -name ".DS_Store" -delete; \
xcodegen --use-cache --cache-path .xcodegen; \
cd Playground; find . -name ".DS_Store" -delete
ifdef lcp
curl --create-dirs --output Playground/R2LCPClient/Package.swift "$(lcp)"
cd Playground; xcodegen -s project+lcp.yml --use-cache --cache-path .xcodegen
else
rm -rf Playground/R2LCPClient
cd Playground; xcodegen -s project.yml --use-cache --cache-path .xcodegen
endif
# The repository might be cloned to a different location than "swift-toolkit".
# XcodeGen will use the name of the folder in the project, which is not desirable.
# This will replace all occurrences of this folder by "swift-toolkit".
Expand Down
12 changes: 0 additions & 12 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -132,18 +132,6 @@ let package = Package(
.process("Resources"),
]
),
// These tests require a R2LCPClient.framework to run.
// TODO: Find a solution to run the tests with GitHub action.
// .testTarget(
// name: "ReadiumLCPTests",
// dependencies: [
// "ReadiumLCP",
// "ReadiumShared",
// "ReadiumStreamer",
// "TestPublications",
// ],
// path: "Tests/LCPTests"
// ),

// Shared test publications used across multiple test targets.
.target(
Expand Down
3 changes: 3 additions & 0 deletions Playground/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/Playground.xcodeproj
/.xcodegen
/R2LCPClient/
109 changes: 0 additions & 109 deletions Playground/.xcodegen

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@
],
"defaultOptions" : {
"codeCoverage" : false,
"language" : "en",
"region" : "US",
"targetForVariableExpansion" : {
"containerPath" : "container:TestApp.xcodeproj",
"identifier" : "BED194980D56484BC288A866",
"name" : "TestApp"
"containerPath" : "container:Playground.xcodeproj",
"identifier" : "739B1FD817D42F0264714A50",
"name" : "Playground"
}
},
"testTargets" : [
Expand Down Expand Up @@ -51,6 +53,13 @@
"identifier" : "ReadiumStreamerTests",
"name" : "ReadiumStreamerTests"
}
},
{
"target" : {
"containerPath" : "container:Playground.xcodeproj",
"identifier" : "577C8AE113CE8235D663EDDB",
"name" : "ReadiumLCPTests"
}
}
],
"version" : 1
Expand Down
Loading