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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/sweetpad-lib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,58 @@ jobs:
run: cargo test --workspace --lib -- --test-threads=1
- name: Python regression checks
run: python3 -B -m unittest discover -s sweetpad-lib/ci -p 'test_*.py'
- name: Check out the CoMaps interface files and asset catalog
uses: actions/checkout@v7
with:
repository: comaps/comaps
ref: 27ea5a9b92b266abe6d1b690e02ad5c89bf95217
path: .build/comaps-source
persist-credentials: false
sparse-checkout-cone-mode: false
sparse-checkout: |
/iphone/Maps/**/*.xib
/iphone/Maps/**/*.storyboard
/iphone/Maps/**/Contents.json
/iphone/Maps/Images.xcassets/
/iphone/Maps/CoMapsWidgetExtension/Assets.xcassets/
- name: Require fixture coverage for every CoMaps resource combination
if: matrix.os == 'ubuntu-24.04'
run: python3 sweetpad-cli/fixtures/resource_gaps.py .build/comaps-source/iphone/Maps --require-covered
- name: Compile CoMaps and the resource regression fixtures on Linux
run: |
cargo build -p sweetpad-cli --bin sweetpad
python3 sweetpad-cli/fixtures/comaps/compile.py target/debug/sweetpad .build/comaps-source "$RUNNER_TEMP/comaps-resources"
- name: Export Linux-built resources for UIKit
if: matrix.os == 'ubuntu-24.04'
uses: actions/upload-artifact@v7
with:
name: comaps-resources
path: ${{ runner.temp }}/comaps-resources
if-no-files-found: error
retention-days: 1
comaps-runtime:
name: CoMaps and resource variants · iPhone simulator
needs: linux
runs-on: macos-latest
timeout-minutes: 25
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
with:
name: comaps-resources
path: ${{ runner.temp }}/comaps-resources
- name: Compare Linux resources with Xcode and load both in UIKit
run: |
xcodebuild -version
python3 sweetpad-cli/fixtures/comaps/simulator.py "$RUNNER_TEMP/comaps-resources" --reference-output "$RUNNER_TEMP/comaps-xcode"
- name: Save Xcode catalogs for a failed comparison
if: failure()
uses: actions/upload-artifact@v7
with:
name: comaps-xcode
path: ${{ runner.temp }}/comaps-xcode
if-no-files-found: ignore
retention-days: 1
check:
name: fmt · clippy · test
runs-on: macos-latest
Expand Down
80 changes: 54 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,11 @@ moxcms = "0.8.1"
# the usvg and roxmltree it re-exports, and svgtypes, which usvg parses
# with). Both are pure Rust; PDF and SVG are standard formats too large to
# hand-roll.
hayro = { version = "0.8", default-features = false }
hayro = { version = "0.9", default-features = false }
resvg = { version = "0.48", default-features = false }
svgtypes = "0.16"
# Keep the original precision when measuring SF Symbols' Bézier control points.
kurbo = "0.13"
# The codesign stand-in signs with an identity exported from Keychain Access:
# RSA signatures, and the Triple DES and AES that a .p12 file's contents are
# encrypted with. The signature formats around them are Apple's, and
Expand Down
1 change: 1 addition & 0 deletions sweetpad-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ moxcms.workspace = true
hayro.workspace = true
resvg.workspace = true
svgtypes.workspace = true
kurbo.workspace = true
rsa.workspace = true
des.workspace = true
aes.workspace = true
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extensions": "a8bbcd75e97087d521c01f979c533dbffa7b411baa2b84ea9488689c98edf1a9",
"no-extensions": "038a6770b0d0d6768d225c8461a4e7ded243e24cc96f464bf1a8248538ba67d7",
"swiftui": "cafdee11310f05491f146db8b83f7489fe14e9c8d24339cd94e17daff31f89ad"
}
17 changes: 14 additions & 3 deletions sweetpad-cli/fixtures/actool/regen.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
python3 -I sweetpad-cli/fixtures/actool/regen.py
"""

import hashlib
import itertools
import json
import os
import shutil
Expand Down Expand Up @@ -92,19 +94,25 @@ def main():
try:
catalog = os.path.join(work, "Probe.xcassets")
build(spec, catalog)
for mode, flags in MODES.items():
out = os.path.join(work, mode)
back_deployed = {}
for target, (mode, flags) in itertools.product(["18.2", "15.6"], MODES.items()):
out = os.path.join(work, f"{target}-{mode}")
os.makedirs(out)
subprocess.run(
["xcrun", "actool", catalog, "--compile", out, "--output-format", "human-readable-text",
"--notices", "--warnings", "--output-partial-info-plist", os.path.join(out, "partial.plist"),
"--app-icon", "AppIcon", "--accent-color", "AccentColor", "--platform", "iphonesimulator",
"--minimum-deployment-target", "18.2", "--target-device", "iphone", "--target-device", "ipad",
"--minimum-deployment-target", target, "--target-device", "iphone", "--target-device", "ipad",
"--bundle-identifier", "dev.sweetpad.Probe", *flags,
"--generate-swift-asset-symbols", os.path.join(out, "Symbols.swift"),
"--generate-objc-asset-symbols", os.path.join(out, "Symbols.h"),
"--generate-asset-symbol-index", os.path.join(out, "Symbols-Index.plist")],
check=True, stdout=subprocess.DEVNULL)
if target == "15.6":
# The same large catalog exercises namespace collisions and thinnable assets in both APIs.
with open(os.path.join(out, "Symbols.swift"), "rb") as f:
back_deployed[mode] = hashlib.sha256(f.read()).hexdigest()
continue
shutil.copy(os.path.join(out, "Symbols.swift"), os.path.join(expected, f"{mode}.swift"))
if mode != "extensions":
# The header and the index don't change with the mode.
Expand All @@ -120,6 +128,9 @@ def main():
with open(os.path.join(expected, "index.json"), "w") as f:
json.dump(index, f, indent=1, ensure_ascii=False)
f.write("\n")
with open(os.path.join(expected, "back-deployed-sha256.json"), "w") as f:
json.dump(back_deployed, f, indent=2)
f.write("\n")
finally:
shutil.rmtree(work)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info": {
"author": "xcode",
"version": 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"info": {
"author": "xcode",
"version": 1
},
"colors": [
{
"color": {
"color-space": "srgb",
"components": {
"red": "0.216",
"green": "0.396",
"blue": "0.247",
"alpha": "1.000"
}
},
"idiom": "universal"
},
{
"color": {
"color-space": "srgb",
"components": {
"red": "0.396",
"green": "0.580",
"blue": "0.392",
"alpha": "1.000"
}
},
"idiom": "universal",
"appearances": [
{
"appearance": "luminosity",
"value": "dark"
}
]
}
]
}
Loading
Loading