Skip to content

Commit

Permalink
Update to GitHub Actions (#11)
Browse files Browse the repository at this point in the history
* wip

* wip

* wip
  • Loading branch information
stephencelis authored Aug 17, 2021
1 parent 8c270e6 commit f1786ea
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 93 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: CI

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

jobs:
macos:
name: MacOS
runs-on: macOS-latest
strategy:
matrix:
xcode:
- 12.4
steps:
- uses: actions/checkout@v2
- name: Select Xcode ${{ matrix.xcode }}
run: sudo xcode-select -s /Applications/Xcode_${{ matrix.xcode }}.app
- name: Print Swift version
run: swift --version
- name: Run tests
run: make test-swift

linux:
name: Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run tests
run: make test-linux
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.

15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

44 changes: 12 additions & 32 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,14 @@
SUDO = sudo --prompt=$(SUDO_PROMPT)
SUDO_PROMPT = " 🔒 Please enter your password: "
SDK_PATH = $(shell xcrun --show-sdk-path 2>/dev/null)
FRAMEWORKS_PATH = $(SDK_PATH)/System/Library/Frameworks

bootstrap: xcodeproj install-mm-xcodeproj

xcodeproj:
swift package generate-xcodeproj
xed .
test-all: test-linux test-swift

test-linux:
docker build --tag html . \
&& docker run --rm html

test-macos: xcodeproj
brew install libressl
set -o pipefail && \
xcodebuild test \
-scheme HtmlVaporSupport-Package \
-destination platform="macOS" \
| xcpretty

linux-main:
swift test --generate-linuxmain

test-swift: linux-main
swift test

test-all: test-linux test-mac

install-mm-xcodeproj: xcodeproj
@ls HtmlVaporSupport.xcodeproj/GeneratedModuleMap | xargs -n1 -I '{}' $(SUDO) mkdir -p "$(FRAMEWORKS_PATH)/{}.framework"
@ls HtmlVaporSupport.xcodeproj/GeneratedModuleMap | xargs -n1 -I '{}' $(SUDO) cp "./HtmlVaporSupport.xcodeproj/GeneratedModuleMap/{}/module.modulemap" "$(FRAMEWORKS_PATH)/{}.framework/module.map"
docker run \
--rm \
-v "$(PWD):$(PWD)" \
-w "$(PWD)" \
swift:5.3 \
bash -c 'make test-swift'

test-swift:
swift test \
--enable-test-discovery \
--parallel
35 changes: 19 additions & 16 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,38 +1,41 @@
// swift-tools-version:5.2
// swift-tools-version:5.3

import PackageDescription

let package = Package(
name: "HtmlVaporSupport",
name: "swift-html-vapor",
platforms: [
.macOS(.v10_15)
],
products: [
.library(
name: "HtmlVaporSupport",
targets: ["HtmlVaporSupport"]),
targets: ["HtmlVaporSupport"]
),
.executable(
name: "HtmlVaporSupportExample",
targets: ["HtmlVaporSupportExample"]),
],
targets: ["HtmlVaporSupportExample"]
),
],
dependencies: [
.package(name: "Html", url: "https://github.com/pointfreeco/swift-html.git", from: "0.3.1"),
.package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"),
],
.package(url: "https://github.com/pointfreeco/swift-html", from: "0.4.0"),
.package(url: "https://github.com/vapor/vapor", from: "4.0.0"),
],
targets: [
.target(
name: "HtmlVaporSupport",
dependencies: [
.product(name: "Html", package: "Html"),
.product(name: "Html", package: "swift-html"),
.product(name: "Vapor", package: "vapor"),
]),
]
),
.testTarget(
name: "HtmlVaporSupportTests",
dependencies: ["HtmlVaporSupport"]),
dependencies: ["HtmlVaporSupport"]
),
.target(
name: "HtmlVaporSupportExample",
dependencies: ["HtmlVaporSupport"]),
],
swiftLanguageVersions: [
.version("5"),
]
dependencies: ["HtmlVaporSupport"]
),
]
)
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# swift-html-vapor

[![Swift 5](https://img.shields.io/badge/swift-5-ED523F.svg?style=flat)](https://swift.org/download/)
[![Swift 4.2](https://img.shields.io/badge/swift-4.2-ED523F.svg?style=flat)](https://swift.org/download/)
[![Swift 5.3](https://img.shields.io/badge/swift-5.3-ED523F.svg?style=flat)](https://swift.org/download/)
[![Linux CI](https://img.shields.io/travis/pointfreeco/swift-html-vapor/master.svg?label=linux)](https://travis-ci.org/pointfreeco/swift-html-vapor)
[![@pointfreeco](https://img.shields.io/badge/[email protected]?style=flat)](https://twitter.com/pointfreeco)

Expand Down Expand Up @@ -54,14 +53,10 @@ If you want to use swift-html-vapor in a project that uses [SwiftPM](https://swi

``` swift
dependencies: [
.package(name: "HtmlVaporSupport", url: "https://github.com/pointfreeco/swift-html-vapor.git", from: "0.4.0")
.package(url: "https://github.com/pointfreeco/swift-html-vapor", from: "0.4.0")
]
```

### Xcode Sub-project

Submodule, clone, or download swift-html-vapor, and drag `HtmlVaporSupport.xcodeproj` into your project.

## License

All modules are released under the MIT license. See [LICENSE](LICENSE) for details.
15 changes: 0 additions & 15 deletions Tests/HtmlVaporSupportTests/XCTestManifests.swift

This file was deleted.

8 changes: 0 additions & 8 deletions Tests/LinuxMain.swift

This file was deleted.

0 comments on commit f1786ea

Please sign in to comment.