Skip to content

Commit 53f56e5

Browse files
🌱
Co-authored-by: Stephen Celis <[email protected]>
0 parents  commit 53f56e5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+13862
-0
lines changed

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- '*'
10+
workflow_dispatch:
11+
12+
jobs:
13+
macos_tests:
14+
runs-on: macos-11
15+
strategy:
16+
matrix:
17+
xcode:
18+
- "13.2.1" # Swift 5.5
19+
command:
20+
- test
21+
- benchmarks
22+
steps:
23+
- uses: actions/checkout@v2
24+
- name: Select Xcode ${{ matrix.xcode }}
25+
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
26+
- name: System
27+
run: system_profiler SPHardwareDataType
28+
- name: Run ${{ matrix.command }}
29+
run: make ${{ matrix.command }}
30+
31+
ubuntu_tests:
32+
strategy:
33+
matrix:
34+
os: [ubuntu-18.04, ubuntu-20.04]
35+
36+
runs-on: ${{ matrix.os }}
37+
38+
steps:
39+
- uses: actions/checkout@v2
40+
- name: Build
41+
run: swift build
42+
- name: Run tests
43+
run: swift test
44+
45+
windows_tests:
46+
runs-on: windows-2019
47+
48+
steps:
49+
- uses: actions/checkout@v2
50+
- uses: MaxDesiatov/swift-windows-action@v1
51+
with:
52+
swift-version: "5.5.1"

.github/workflows/documentation.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Build and deploy DocC to GitHub pages. Based off of @karwa's work here:
2+
# https://github.com/karwa/swift-url/blob/main/.github/workflows/docs.yml
3+
name: Documentation
4+
5+
on:
6+
release:
7+
types:
8+
- published
9+
push:
10+
branches:
11+
- main
12+
workflow_dispatch:
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout Package
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Download Swift 5.5.1
24+
run: wget -q https://download.swift.org/swift-5.5.1-release/ubuntu2004/swift-5.5.1-RELEASE/swift-5.5.1-RELEASE-ubuntu20.04.tar.gz
25+
- name: Extract Swift 5.5.1
26+
run: tar xzf swift-5.5.1-RELEASE-ubuntu20.04.tar.gz
27+
- name: Add Swift toolchain to PATH
28+
run: |
29+
echo "$GITHUB_WORKSPACE/swift-5.5.1-RELEASE-ubuntu20.04/usr/bin" >> $GITHUB_PATH
30+
31+
- name: Checkout swift-docc
32+
uses: actions/checkout@v2
33+
with:
34+
repository: apple/swift-docc
35+
ref: main
36+
path: swift-docc
37+
- name: Cache DocC
38+
id: cache-docc
39+
uses: actions/cache@v2
40+
with:
41+
key: swift-url-docc-build
42+
path: swift-docc/.build
43+
- name: Build swift-docc
44+
if: ${{ !steps.cache-docc.outputs.cache-hit }}
45+
run: |
46+
cd swift-docc; swift build --product docc -c release; cd ..
47+
48+
- name: Checkout swift-docc-render
49+
uses: actions/checkout@v2
50+
with:
51+
repository: apple/swift-docc-render
52+
ref: main
53+
path: swift-docc-render
54+
- name: Build swift-docc-render
55+
run: |
56+
cd swift-docc-render; npm install && npm run build; cd ..
57+
58+
- name: Checkout gh-pages Branch
59+
uses: actions/checkout@v2
60+
with:
61+
ref: gh-pages
62+
path: docs-out
63+
64+
- name: Build documentation
65+
run: >
66+
rm -rf docs-out/.git;
67+
rm -rf docs-out/main;
68+
69+
for tag in $(echo "main"; git tag);
70+
do
71+
echo "⏳ Generating documentation for "$tag" release.";
72+
73+
if [ -d "docs-out/$tag" ]
74+
then
75+
echo "✅ Documentation for "$tag" already exists.";
76+
else
77+
git checkout "$tag";
78+
mkdir -p Sources/URLRouting/Documentation.docc;
79+
export DOCC_HTML_DIR="$(pwd)/swift-docc-render/dist";
80+
81+
rm -rf .build/symbol-graphs;
82+
mkdir -p .build/symbol-graphs;
83+
swift build \
84+
--target URLRouting \
85+
-Xswiftc \
86+
-emit-symbol-graph \
87+
-Xswiftc \
88+
-emit-symbol-graph-dir \
89+
-Xswiftc \
90+
.build/symbol-graphs \
91+
&& swift-docc/.build/release/docc convert Sources/URLRouting/Documentation.docc \
92+
--fallback-display-name URLRouting \
93+
--fallback-bundle-identifier co.pointfree.URLRouting \
94+
--fallback-bundle-version 0.0.0 \
95+
--additional-symbol-graph-dir \
96+
.build/symbol-graphs \
97+
--transform-for-static-hosting \
98+
--hosting-base-path /swift-url-routing/"$tag" \
99+
--output-path docs-out/"$tag" \
100+
&& echo "✅ Documentation generated for "$tag" release." \
101+
|| echo "⚠️ Documentation skipped for "$tag".";
102+
fi;
103+
done
104+
105+
- name: Fix permissions
106+
run: 'sudo chown --recursive $USER docs-out'
107+
- name: Publish documentation to GitHub Pages
108+
uses: JamesIves/[email protected]
109+
with:
110+
branch: gh-pages
111+
folder: docs-out
112+
single-commit: true

.github/workflows/format.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Format
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
swift_format:
10+
name: swift-format
11+
runs-on: macOS-11
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Xcode Select
15+
run: sudo xcode-select -s /Applications/Xcode_13.0.app
16+
- name: Tap
17+
run: brew tap pointfreeco/formulae
18+
- name: Install
19+
run: brew install Formulae/[email protected]
20+
- name: Format
21+
run: make format
22+
- uses: stefanzweifel/git-auto-commit-action@v4
23+
with:
24+
commit_message: Run swift-format
25+
branch: 'main'
26+
env:
27+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
/*.xcodeproj
5+
xcuserdata/

.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1330"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "URLRouting"
18+
BuildableName = "URLRouting"
19+
BlueprintName = "URLRouting"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "YES"
27+
buildForArchiving = "YES"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "swift-url-routing-benchmark"
32+
BuildableName = "swift-url-routing-benchmark"
33+
BlueprintName = "swift-url-routing-benchmark"
34+
ReferencedContainer = "container:">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
<BuildActionEntry
38+
buildForTesting = "YES"
39+
buildForRunning = "YES"
40+
buildForProfiling = "YES"
41+
buildForArchiving = "YES"
42+
buildForAnalyzing = "YES">
43+
<BuildableReference
44+
BuildableIdentifier = "primary"
45+
BlueprintIdentifier = "variadics-generator"
46+
BuildableName = "variadics-generator"
47+
BlueprintName = "variadics-generator"
48+
ReferencedContainer = "container:">
49+
</BuildableReference>
50+
</BuildActionEntry>
51+
<BuildActionEntry
52+
buildForTesting = "YES"
53+
buildForRunning = "YES"
54+
buildForProfiling = "NO"
55+
buildForArchiving = "NO"
56+
buildForAnalyzing = "YES">
57+
<BuildableReference
58+
BuildableIdentifier = "primary"
59+
BlueprintIdentifier = "URLRoutingTests"
60+
BuildableName = "URLRoutingTests"
61+
BlueprintName = "URLRoutingTests"
62+
ReferencedContainer = "container:">
63+
</BuildableReference>
64+
</BuildActionEntry>
65+
</BuildActionEntries>
66+
</BuildAction>
67+
<TestAction
68+
buildConfiguration = "Debug"
69+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
70+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
71+
shouldUseLaunchSchemeArgsEnv = "YES">
72+
<Testables>
73+
<TestableReference
74+
skipped = "NO">
75+
<BuildableReference
76+
BuildableIdentifier = "primary"
77+
BlueprintIdentifier = "URLRoutingTests"
78+
BuildableName = "URLRoutingTests"
79+
BlueprintName = "URLRoutingTests"
80+
ReferencedContainer = "container:">
81+
</BuildableReference>
82+
</TestableReference>
83+
</Testables>
84+
</TestAction>
85+
<LaunchAction
86+
buildConfiguration = "Debug"
87+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
88+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
89+
launchStyle = "0"
90+
useCustomWorkingDirectory = "NO"
91+
ignoresPersistentStateOnLaunch = "NO"
92+
debugDocumentVersioning = "YES"
93+
debugServiceExtension = "internal"
94+
allowLocationSimulation = "YES">
95+
<MacroExpansion>
96+
<BuildableReference
97+
BuildableIdentifier = "primary"
98+
BlueprintIdentifier = "swift-url-routing-benchmark"
99+
BuildableName = "swift-url-routing-benchmark"
100+
BlueprintName = "swift-url-routing-benchmark"
101+
ReferencedContainer = "container:">
102+
</BuildableReference>
103+
</MacroExpansion>
104+
</LaunchAction>
105+
<ProfileAction
106+
buildConfiguration = "Release"
107+
shouldUseLaunchSchemeArgsEnv = "YES"
108+
savedToolIdentifier = ""
109+
useCustomWorkingDirectory = "NO"
110+
debugDocumentVersioning = "YES">
111+
<MacroExpansion>
112+
<BuildableReference
113+
BuildableIdentifier = "primary"
114+
BlueprintIdentifier = "variadics-generator"
115+
BuildableName = "variadics-generator"
116+
BlueprintName = "variadics-generator"
117+
ReferencedContainer = "container:">
118+
</BuildableReference>
119+
</MacroExpansion>
120+
</ProfileAction>
121+
<AnalyzeAction
122+
buildConfiguration = "Debug">
123+
</AnalyzeAction>
124+
<ArchiveAction
125+
buildConfiguration = "Release"
126+
revealArchiveInOrganizer = "YES">
127+
</ArchiveAction>
128+
</Scheme>

0 commit comments

Comments
 (0)