Skip to content

Commit

Permalink
Merge pull request #12 from composed-swift/add-github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephDuffy authored Sep 21, 2020
2 parents 7aa4c8f + c5269e0 commit 8ee5b11
Show file tree
Hide file tree
Showing 11 changed files with 289 additions and 2 deletions.
80 changes: 80 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Release

on:
push:
tags: "*"

jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Fetch tag
run: git fetch --depth=1 origin +${{ github.ref }}:${{ github.ref }}

- name: Get the release version
id: release_version
run: echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"

- name: Get release description
run: |
description="$(git tag -ln --format=$'%(contents:subject)\n\n%(contents:body)' ${{ steps.release_version.outputs.version }})"
# Fix set-output for multiline strings: https://github.community/t/set-output-truncates-multiline-strings/16852
description="${description//'%'/'%25'}"
description="${description//$'\n'/'%0A'}"
description="${description//$'\r'/'%0D'}"
echo "$description"
echo "::set-output name=description::$description"
id: release_description

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.release_version.outputs.version }}
release_name: ${{ steps.release_version.outputs.version }}
body: ${{ steps.release_description.outputs.description }}
prerelease: ${{ startsWith(steps.release_version.outputs.version, '0.') || contains(steps.release_version.outputs.version, '-') }}

build_docs:
name: Build Docs
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
xcode: ["11.7"]

steps:
- uses: actions/checkout@v2

- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app

- name: Setup Ruby
uses: ruby/setup-ruby@v1

- uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('.ruby-version') }}-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-${{ hashFiles('.ruby-version') }}-
- name: Bundle install
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Build docs
run: bundle exec jazzy

- name: Upload Docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs
38 changes: 38 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Tests

on: [push]

jobs:
xcode_tests:
name: ${{ matrix.platform }} Tests (Xcode ${{ matrix.xcode }})
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
xcode: ["11.7", "12"]
platform: ["iOS"]

steps:
- uses: actions/checkout@v2

- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select --switch /Applications/Xcode_${{ matrix.xcode }}.app

- name: Cache SwiftPM
uses: actions/cache@v2
with:
path: CIDependencies/.build
key: ${{ runner.os }}-xcode_${{ matrix.xcode }}-swiftpm-ci-deps-${{ github.workspace }}-${{ hashFiles('CIDependencies/Package.resolved') }}
restore-keys: |
${{ runner.os }}-xcode_${{ matrix.xcode }}-swiftpm-ci-deps-${{ github.workspace }}
- name: Cache DerivedData
uses: actions/cache@v2
with:
path: ~/Library/Developer/Xcode/DerivedData
key: ${{ runner.os }}-${{ matrix.platform }}_derived_data-xcode_${{ matrix.xcode }}
restore-keys: |
${{ runner.os }}-${{ matrix.platform }}_derived_data
- name: Run Tests
run: swift run --configuration release --skip-update --package-path ./CIDependencies/ xcutils test ${{ matrix.platform }} --scheme ComposedUI --enable-code-coverage
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
/.build
.build
/Packages
/*.xcodeproj
xcuserdata/
docs/
5 changes: 5 additions & 0 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
author: "Composed Swift"
github_url: https://github.com/composed-swift/ComposedUI
undocumented_text: ""
swift_build_tool: xcodebuild
xcodebuild_arguments: [-scheme, ComposedUI, -sdk, iphonesimulator]
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.1
34 changes: 34 additions & 0 deletions CIDependencies/Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"object": {
"pins": [
{
"package": "swift-argument-parser",
"repositoryURL": "https://github.com/apple/swift-argument-parser",
"state": {
"branch": null,
"revision": "223d62adc52d51669ae2ee19bdb8b7d9fd6fcd9c",
"version": "0.0.6"
}
},
{
"package": "Version",
"repositoryURL": "https://github.com/mxcl/Version.git",
"state": {
"branch": null,
"revision": "200046c93f6d5d78a6d72bfd9c0b27a95e9c0a2b",
"version": "1.2.0"
}
},
{
"package": "xcutils",
"repositoryURL": "https://github.com/JosephDuffy/xcutils.git",
"state": {
"branch": null,
"revision": "6113a82e2910341f4a7e65ac245796136cf6001c",
"version": "0.1.1"
}
}
]
},
"version": 1
}
15 changes: 15 additions & 0 deletions CIDependencies/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// swift-tools-version:5.2
import PackageDescription

let package = Package(
name: "CIDependencies",
platforms: [
.macOS(.v10_10),
],
dependencies: [
.package(url: "https://github.com/JosephDuffy/xcutils.git", from: "0.1.0"),
],
targets: [
.target(name: "CIDependencies")
]
)
1 change: 1 addition & 0 deletions CIDependencies/Sources/CIDependencies/Empty.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// An empty file to make this a valid target
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "jazzy"
109 changes: 109 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.2)
activesupport (4.2.11.3)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
algoliasearch (1.27.4)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.0.3)
cocoapods (1.9.3)
activesupport (>= 4.0.2, < 5)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.9.3)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.2.2, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.6.6)
nap (~> 1.0)
ruby-macho (~> 1.4)
xcodeproj (>= 1.14.0, < 2.0)
cocoapods-core (1.9.3)
activesupport (>= 4.0.2, < 6)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.4.0)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.5.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.1.7)
escape (0.0.4)
ethon (0.12.0)
ffi (>= 1.3.0)
ffi (1.13.1)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
jazzy (0.13.5)
cocoapods (~> 1.5)
mustache (~> 1.1)
open4
redcarpet (~> 3.4)
rouge (>= 2.0.6, < 4.0)
sassc (~> 2.1)
sqlite3 (~> 1.3)
xcinvoke (~> 0.3.0)
json (2.3.1)
liferaft (0.0.6)
minitest (5.14.2)
molinillo (0.6.6)
mustache (1.1.1)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
open4 (1.3.4)
redcarpet (3.5.0)
rouge (3.23.0)
ruby-macho (1.4.0)
sassc (2.4.0)
ffi (~> 1.9)
sqlite3 (1.4.2)
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.7)
thread_safe (~> 0.1)
xcinvoke (0.3.0)
liferaft (~> 0.0.6)
xcodeproj (1.18.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)

PLATFORMS
ruby

DEPENDENCIES
jazzy

BUNDLED WITH
2.1.4
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ let package = Package(
dependencies: ["Composed"]),
.testTarget(
name: "ComposedUITests",
dependencies: ["Composed"]),
dependencies: ["Composed", "ComposedUI"]),
]
)

0 comments on commit 8ee5b11

Please sign in to comment.