Skip to content

Commit

Permalink
🌱
Browse files Browse the repository at this point in the history
Co-authored-by: Stephen Celis <[email protected]>
  • Loading branch information
mbrandonw and stephencelis committed May 2, 2022
0 parents commit 53f56e5
Show file tree
Hide file tree
Showing 45 changed files with 13,862 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- '*'
workflow_dispatch:

jobs:
macos_tests:
runs-on: macos-11
strategy:
matrix:
xcode:
- "13.2.1" # Swift 5.5
command:
- test
- benchmarks
steps:
- uses: actions/checkout@v2
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: System
run: system_profiler SPHardwareDataType
- name: Run ${{ matrix.command }}
run: make ${{ matrix.command }}

ubuntu_tests:
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Build
run: swift build
- name: Run tests
run: swift test

windows_tests:
runs-on: windows-2019

steps:
- uses: actions/checkout@v2
- uses: MaxDesiatov/swift-windows-action@v1
with:
swift-version: "5.5.1"
112 changes: 112 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Build and deploy DocC to GitHub pages. Based off of @karwa's work here:
# https://github.com/karwa/swift-url/blob/main/.github/workflows/docs.yml
name: Documentation

on:
release:
types:
- published
push:
branches:
- main
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Package
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Download Swift 5.5.1
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
- name: Extract Swift 5.5.1
run: tar xzf swift-5.5.1-RELEASE-ubuntu20.04.tar.gz
- name: Add Swift toolchain to PATH
run: |
echo "$GITHUB_WORKSPACE/swift-5.5.1-RELEASE-ubuntu20.04/usr/bin" >> $GITHUB_PATH
- name: Checkout swift-docc
uses: actions/checkout@v2
with:
repository: apple/swift-docc
ref: main
path: swift-docc
- name: Cache DocC
id: cache-docc
uses: actions/cache@v2
with:
key: swift-url-docc-build
path: swift-docc/.build
- name: Build swift-docc
if: ${{ !steps.cache-docc.outputs.cache-hit }}
run: |
cd swift-docc; swift build --product docc -c release; cd ..
- name: Checkout swift-docc-render
uses: actions/checkout@v2
with:
repository: apple/swift-docc-render
ref: main
path: swift-docc-render
- name: Build swift-docc-render
run: |
cd swift-docc-render; npm install && npm run build; cd ..
- name: Checkout gh-pages Branch
uses: actions/checkout@v2
with:
ref: gh-pages
path: docs-out

- name: Build documentation
run: >
rm -rf docs-out/.git;
rm -rf docs-out/main;
for tag in $(echo "main"; git tag);
do
echo "⏳ Generating documentation for "$tag" release.";
if [ -d "docs-out/$tag" ]
then
echo "✅ Documentation for "$tag" already exists.";
else
git checkout "$tag";
mkdir -p Sources/URLRouting/Documentation.docc;
export DOCC_HTML_DIR="$(pwd)/swift-docc-render/dist";
rm -rf .build/symbol-graphs;
mkdir -p .build/symbol-graphs;
swift build \
--target URLRouting \
-Xswiftc \
-emit-symbol-graph \
-Xswiftc \
-emit-symbol-graph-dir \
-Xswiftc \
.build/symbol-graphs \
&& swift-docc/.build/release/docc convert Sources/URLRouting/Documentation.docc \
--fallback-display-name URLRouting \
--fallback-bundle-identifier co.pointfree.URLRouting \
--fallback-bundle-version 0.0.0 \
--additional-symbol-graph-dir \
.build/symbol-graphs \
--transform-for-static-hosting \
--hosting-base-path /swift-url-routing/"$tag" \
--output-path docs-out/"$tag" \
&& echo "✅ Documentation generated for "$tag" release." \
|| echo "⚠️ Documentation skipped for "$tag".";
fi;
done
- name: Fix permissions
run: 'sudo chown --recursive $USER docs-out'
- name: Publish documentation to GitHub Pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs-out
single-commit: true
27 changes: 27 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Format

on:
push:
branches:
- main

jobs:
swift_format:
name: swift-format
runs-on: macOS-11
steps:
- uses: actions/checkout@v2
- name: Xcode Select
run: sudo xcode-select -s /Applications/Xcode_13.0.app
- name: Tap
run: brew tap pointfreeco/formulae
- name: Install
run: brew install Formulae/[email protected]
- name: Format
run: make format
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Run swift-format
branch: 'main'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

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

128 changes: 128 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/URLRouting-Package.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1330"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "URLRouting"
BuildableName = "URLRouting"
BlueprintName = "URLRouting"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "swift-url-routing-benchmark"
BuildableName = "swift-url-routing-benchmark"
BlueprintName = "swift-url-routing-benchmark"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "variadics-generator"
BuildableName = "variadics-generator"
BlueprintName = "variadics-generator"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "URLRoutingTests"
BuildableName = "URLRoutingTests"
BlueprintName = "URLRoutingTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "URLRoutingTests"
BuildableName = "URLRoutingTests"
BlueprintName = "URLRoutingTests"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "swift-url-routing-benchmark"
BuildableName = "swift-url-routing-benchmark"
BlueprintName = "swift-url-routing-benchmark"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "variadics-generator"
BuildableName = "variadics-generator"
BlueprintName = "variadics-generator"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Loading

0 comments on commit 53f56e5

Please sign in to comment.