Skip to content

Commit b4e0909

Browse files
authored
Merge pull request #15 from playbook-ui/chore/update-tools
chore: Update tools
2 parents 333d88b + 0246973 commit b4e0909

File tree

11 files changed

+193
-205
lines changed

11 files changed

+193
-205
lines changed

.github/workflows/test.yml

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ on:
77
jobs:
88
test:
99
name: Test on macOS
10-
runs-on: macOS-11.0
10+
runs-on: macos-11
1111
strategy:
1212
matrix:
1313
xcode_version:
14-
- "12.2"
14+
- 12.4
15+
- 12.5.1
1516
env:
1617
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app
1718
steps:
@@ -21,14 +22,6 @@ jobs:
2122
swift --version
2223
xcodebuild -version
2324
24-
- name: Get ruby gem cache
25-
id: gem-cache
26-
uses: actions/cache@v2
27-
with:
28-
path: vendor/bundle
29-
key: ${{ runner.os }}-1-gem-${{ hashFiles('Gemfile.lock') }}
30-
restore-keys: ${{ runner.os }}-1-gem-
31-
3225
- name: Get npm cache
3326
id: npm-cache
3427
uses: actions/cache@v2
@@ -37,18 +30,26 @@ jobs:
3730
key: ${{ runner.os }}-0-npm-${{ hashFiles('package-lock.json') }}
3831
restore-keys: ${{ runner.os }}-0-npm-
3932

33+
- name: Get ruby gem cache
34+
id: gem-cache
35+
uses: actions/cache@v2
36+
with:
37+
path: vendor/bundle
38+
key: ${{ runner.os }}-1-gem-${{ hashFiles('Gemfile.lock') }}
39+
restore-keys: ${{ runner.os }}-1-gem-
40+
4041
- name: Get SwiftPM cache
4142
uses: actions/cache@v2
4243
with:
4344
path: Tools/.build
44-
key: ${{ runner.os }}-${{ matrix.xcode_version }}-2-spm-${{ hashFiles('Tools/Package.resolved') }}
45-
restore-keys: ${{ runner.os }}-${{ matrix.xcode_version }}-2-spm-
45+
key: ${{ runner.os }}-${{ matrix.xcode_version }}-1-spm-${{ hashFiles('Tools/Package.resolved') }}
46+
restore-keys: ${{ runner.os }}-${{ matrix.xcode_version }}-1-spm-
4647

4748
- name: Get CocoaPods cache
4849
id: cocoapods-cache
4950
uses: actions/cache@v2
5051
with:
51-
path: Pods
52+
path: Example/Pods
5253
key: ${{ runner.os }}-1-cocoapods-${{ hashFiles('Example/Podfile.lock') }}
5354
restore-keys: ${{ runner.os }}-1-cocoapods-
5455

@@ -60,18 +61,18 @@ jobs:
6061
if: steps.gem-cache.cache.outputs.cache-hit != 'true'
6162
run: make gem
6263

63-
- name: Podspec lint
64-
run: make pod-lib-lint
65-
6664
- name: Validation
67-
run: make all && [ -z "$(git status --porcelain)" ] && make lint
68-
env:
69-
SPM_FORCE_BUILD: 1
65+
if: matrix.xcode_version == '12.5.1'
66+
run: |
67+
make all && [ -z "$(git status --porcelain)" ]
68+
make lint
69+
make pod-lib-lint
7070
7171
- name: Generate snapshots
72-
run: set -o pipefail && xcodebuild build-for-testing test-without-building -workspace Example/Example.xcworkspace -scheme SampleApp -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12 Pro' ENABLE_TESTABILITY=YES | xcpretty -c
72+
run: xcodebuild test -workspace Example/Example.xcworkspace -scheme SampleApp -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 12 Pro' ENABLE_TESTABILITY=YES | xcpretty -c
7373

7474
- name: Visual regression test
75+
if: matrix.xcode_version == '12.5.1'
7576
run: npx percy upload Example/Snapshots
7677
env:
7778
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
File renamed without changes.

Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SWIFT_TOOL := Tools/swift-run.sh
1+
SWIFT_RUN := swift run -c release
22
GITHUB_RAW_CONTENT_PATH := https://raw.githubusercontent.com/playbook-ui/accessibility-snapshot-ios/main/
33
GITHUB_TREE_PATH := https://github.com/playbook-ui/accessibility-snapshot-ios/main/
44

@@ -7,7 +7,7 @@ all: proj format
77

88
.PHONY: proj
99
proj:
10-
$(SWIFT_TOOL) xcodegen --spec Example/project.yml --project Example
10+
$(SWIFT_RUN) --package-path Tools xcodegen --spec Example/project.yml --project Example
1111
make pod-install
1212

1313
.PHONY: pod-install
@@ -16,12 +16,11 @@ pod-install:
1616

1717
.PHONY: format
1818
format:
19-
$(SWIFT_TOOL) swift-mod
20-
$(SWIFT_TOOL) swift-format --configuration .swift-format.json -i -r -m format Sources Example/SampleAccessibilitySnapshot
19+
$(SWIFT_RUN) --package-path Tools swift-format -i -r -m format Sources Example/SampleAccessibilitySnapshot
2120

2221
.PHONY: lint
2322
lint:
24-
$(SWIFT_TOOL) swift-format --configuration .swift-format.json -r -m lint Sources Example/SampleAccessibilitySnapshot
23+
$(SWIFT_RUN) --package-path Tools swift-format -r -m lint Sources Example/SampleAccessibilitySnapshot
2524

2625
.PHONY: pod-lib-lint
2726
pod-lib-lint:
@@ -42,7 +41,7 @@ npm:
4241

4342
.PHONY: docs
4443
docs:
45-
$(SWIFT_TOOL) swift-doc generate Sources -n PlaybookAccessibilitySnapshot -f html -o docs --base-url https://playbook-ui.github.io/accessibility-snapshot-ios
44+
$(SWIFT_RUN) --package-path Tools/Doc swift-doc generate Sources -n PlaybookAccessibilitySnapshot -f html -o docs --base-url https://playbook-ui.github.io/accessibility-snapshot-ios
4645

4746
.PHONY: fix-readme-links
4847
fix-readme-links:

Tools/Doc/Package.resolved

Lines changed: 124 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Tools/Doc/Package.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// swift-tools-version:5.3
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "Doc",
6+
dependencies: [
7+
.package(url: "https://github.com/SwiftDocOrg/swift-doc.git", .branch("1.0.0-rc.1")),
8+
]
9+
)

0 commit comments

Comments
 (0)