Skip to content

Commit 8ee5b11

Browse files
authored
Merge pull request #12 from composed-swift/add-github-actions
2 parents 7aa4c8f + c5269e0 commit 8ee5b11

File tree

11 files changed

+289
-2
lines changed

11 files changed

+289
-2
lines changed

.github/workflows/release.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: "*"
6+
7+
jobs:
8+
create_release:
9+
name: Create Release
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Fetch tag
16+
run: git fetch --depth=1 origin +${{ github.ref }}:${{ github.ref }}
17+
18+
- name: Get the release version
19+
id: release_version
20+
run: echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"
21+
22+
- name: Get release description
23+
run: |
24+
description="$(git tag -ln --format=$'%(contents:subject)\n\n%(contents:body)' ${{ steps.release_version.outputs.version }})"
25+
# Fix set-output for multiline strings: https://github.aichem.orgmunity/t/set-output-truncates-multiline-strings/16852
26+
description="${description//'%'/'%25'}"
27+
description="${description//$'\n'/'%0A'}"
28+
description="${description//$'\r'/'%0D'}"
29+
echo "$description"
30+
echo "::set-output name=description::$description"
31+
id: release_description
32+
33+
- name: Create Release
34+
id: create_release
35+
uses: actions/create-release@v1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
with:
39+
tag_name: ${{ steps.release_version.outputs.version }}
40+
release_name: ${{ steps.release_version.outputs.version }}
41+
body: ${{ steps.release_description.outputs.description }}
42+
prerelease: ${{ startsWith(steps.release_version.outputs.version, '0.') || contains(steps.release_version.outputs.version, '-') }}
43+
44+
build_docs:
45+
name: Build Docs
46+
runs-on: macos-latest
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
xcode: ["11.7"]
51+
52+
steps:
53+
- uses: actions/checkout@v2
54+
55+
- name: Select Xcode ${{ matrix.xcode }}
56+
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app
57+
58+
- name: Setup Ruby
59+
uses: ruby/setup-ruby@v1
60+
61+
- uses: actions/cache@v2
62+
with:
63+
path: vendor/bundle
64+
key: ${{ runner.os }}-gems-${{ hashFiles('.ruby-version') }}-${{ hashFiles('**/Gemfile.lock') }}
65+
restore-keys: |
66+
${{ runner.os }}-gems-${{ hashFiles('.ruby-version') }}-
67+
68+
- name: Bundle install
69+
run: |
70+
bundle config path vendor/bundle
71+
bundle install --jobs 4 --retry 3
72+
73+
- name: Build docs
74+
run: bundle exec jazzy
75+
76+
- name: Upload Docs
77+
uses: peaceiris/actions-gh-pages@v3
78+
with:
79+
github_token: ${{ secrets.GITHUB_TOKEN }}
80+
publish_dir: docs

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Tests
2+
3+
on: [push]
4+
5+
jobs:
6+
xcode_tests:
7+
name: ${{ matrix.platform }} Tests (Xcode ${{ matrix.xcode }})
8+
runs-on: macos-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
xcode: ["11.7", "12"]
13+
platform: ["iOS"]
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Select Xcode ${{ matrix.xcode }}
19+
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app
20+
21+
- name: Cache SwiftPM
22+
uses: actions/cache@v2
23+
with:
24+
path: CIDependencies/.build
25+
key: ${{ runner.os }}-xcode_${{ matrix.xcode }}-swiftpm-ci-deps-${{ github.workspace }}-${{ hashFiles('CIDependencies/Package.resolved') }}
26+
restore-keys: |
27+
${{ runner.os }}-xcode_${{ matrix.xcode }}-swiftpm-ci-deps-${{ github.workspace }}
28+
29+
- name: Cache DerivedData
30+
uses: actions/cache@v2
31+
with:
32+
path: ~/Library/Developer/Xcode/DerivedData
33+
key: ${{ runner.os }}-${{ matrix.platform }}_derived_data-xcode_${{ matrix.xcode }}
34+
restore-keys: |
35+
${{ runner.os }}-${{ matrix.platform }}_derived_data
36+
37+
- name: Run Tests
38+
run: swift run --configuration release --skip-update --package-path ./CIDependencies/ xcutils test ${{ matrix.platform }} --scheme ComposedUI --enable-code-coverage

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.DS_Store
2-
/.build
2+
.build
33
/Packages
44
/*.xcodeproj
55
xcuserdata/
6+
docs/

.jazzy.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
author: "Composed Swift"
2+
github_url: https://github.com/composed-swift/ComposedUI
3+
undocumented_text: ""
4+
swift_build_tool: xcodebuild
5+
xcodebuild_arguments: [-scheme, ComposedUI, -sdk, iphonesimulator]

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.7.1

CIDependencies/Package.resolved

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

CIDependencies/Package.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// swift-tools-version:5.2
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "CIDependencies",
6+
platforms: [
7+
.macOS(.v10_10),
8+
],
9+
dependencies: [
10+
.package(url: "https://github.com/JosephDuffy/xcutils.git", from: "0.1.0"),
11+
],
12+
targets: [
13+
.target(name: "CIDependencies")
14+
]
15+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// An empty file to make this a valid target

Gemfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source "https://rubygems.org"
2+
3+
gem "jazzy"

Gemfile.lock

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.2)
5+
activesupport (4.2.11.3)
6+
i18n (~> 0.7)
7+
minitest (~> 5.1)
8+
thread_safe (~> 0.3, >= 0.3.4)
9+
tzinfo (~> 1.1)
10+
algoliasearch (1.27.4)
11+
httpclient (~> 2.8, >= 2.8.3)
12+
json (>= 1.5.1)
13+
atomos (0.1.3)
14+
claide (1.0.3)
15+
cocoapods (1.9.3)
16+
activesupport (>= 4.0.2, < 5)
17+
claide (>= 1.0.2, < 2.0)
18+
cocoapods-core (= 1.9.3)
19+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
20+
cocoapods-downloader (>= 1.2.2, < 2.0)
21+
cocoapods-plugins (>= 1.0.0, < 2.0)
22+
cocoapods-search (>= 1.0.0, < 2.0)
23+
cocoapods-stats (>= 1.0.0, < 2.0)
24+
cocoapods-trunk (>= 1.4.0, < 2.0)
25+
cocoapods-try (>= 1.1.0, < 2.0)
26+
colored2 (~> 3.1)
27+
escape (~> 0.0.4)
28+
fourflusher (>= 2.3.0, < 3.0)
29+
gh_inspector (~> 1.0)
30+
molinillo (~> 0.6.6)
31+
nap (~> 1.0)
32+
ruby-macho (~> 1.4)
33+
xcodeproj (>= 1.14.0, < 2.0)
34+
cocoapods-core (1.9.3)
35+
activesupport (>= 4.0.2, < 6)
36+
algoliasearch (~> 1.0)
37+
concurrent-ruby (~> 1.1)
38+
fuzzy_match (~> 2.0.4)
39+
nap (~> 1.0)
40+
netrc (~> 0.11)
41+
typhoeus (~> 1.0)
42+
cocoapods-deintegrate (1.0.4)
43+
cocoapods-downloader (1.4.0)
44+
cocoapods-plugins (1.0.0)
45+
nap
46+
cocoapods-search (1.0.0)
47+
cocoapods-stats (1.1.0)
48+
cocoapods-trunk (1.5.0)
49+
nap (>= 0.8, < 2.0)
50+
netrc (~> 0.11)
51+
cocoapods-try (1.2.0)
52+
colored2 (3.1.2)
53+
concurrent-ruby (1.1.7)
54+
escape (0.0.4)
55+
ethon (0.12.0)
56+
ffi (>= 1.3.0)
57+
ffi (1.13.1)
58+
fourflusher (2.3.1)
59+
fuzzy_match (2.0.4)
60+
gh_inspector (1.1.3)
61+
httpclient (2.8.3)
62+
i18n (0.9.5)
63+
concurrent-ruby (~> 1.0)
64+
jazzy (0.13.5)
65+
cocoapods (~> 1.5)
66+
mustache (~> 1.1)
67+
open4
68+
redcarpet (~> 3.4)
69+
rouge (>= 2.0.6, < 4.0)
70+
sassc (~> 2.1)
71+
sqlite3 (~> 1.3)
72+
xcinvoke (~> 0.3.0)
73+
json (2.3.1)
74+
liferaft (0.0.6)
75+
minitest (5.14.2)
76+
molinillo (0.6.6)
77+
mustache (1.1.1)
78+
nanaimo (0.3.0)
79+
nap (1.1.0)
80+
netrc (0.11.0)
81+
open4 (1.3.4)
82+
redcarpet (3.5.0)
83+
rouge (3.23.0)
84+
ruby-macho (1.4.0)
85+
sassc (2.4.0)
86+
ffi (~> 1.9)
87+
sqlite3 (1.4.2)
88+
thread_safe (0.3.6)
89+
typhoeus (1.4.0)
90+
ethon (>= 0.9.0)
91+
tzinfo (1.2.7)
92+
thread_safe (~> 0.1)
93+
xcinvoke (0.3.0)
94+
liferaft (~> 0.0.6)
95+
xcodeproj (1.18.0)
96+
CFPropertyList (>= 2.3.3, < 4.0)
97+
atomos (~> 0.1.3)
98+
claide (>= 1.0.2, < 2.0)
99+
colored2 (~> 3.1)
100+
nanaimo (~> 0.3.0)
101+
102+
PLATFORMS
103+
ruby
104+
105+
DEPENDENCIES
106+
jazzy
107+
108+
BUNDLED WITH
109+
2.1.4

0 commit comments

Comments
 (0)