Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test using GH actions #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test
on:
push:
branches: [ master ]
pull_request:
jobs:
Ubuntu:
runs-on: ubuntu-18.04
strategy:
matrix:
swift: ['5.1', '5.2']
steps:
- uses: actions/checkout@v2
- name: Setup Swift ${{ matrix.swift }}
run: |
sudo apt install libavahi-compat-libdnssd-dev libsodium-dev libssl-dev
wget https://swift.org/builds/swift-${{ matrix.swift }}-release/ubuntu1804/swift-${{ matrix.swift }}-RELEASE/swift-${{ matrix.swift }}-RELEASE-ubuntu18.04.tar.gz
tar xzf swift-${{ matrix.swift }}-RELEASE-ubuntu18.04.tar.gz
export PATH=`pwd`/swift-${{ matrix.swift }}-RELEASE-ubuntu18.04/usr/bin:"${PATH}"
- name: Run Tests
run: swift test -c release -Xswiftc -enable-testing
macOS:
runs-on: macos-latest
continue-on-error: ${{ matrix.swift == '5.3' }}
strategy:
matrix:
swift: ['5.1', '5.2', '5.3']
steps:
- uses: actions/checkout@v2
- name: Setup Swift 5.1
run: sudo xcode-select -s /Applications/Xcode_11.3.1.app/Contents/Developer
if: matrix.swift == '5.1'
- name: Setup Swift 5.2
run: sudo xcode-select -s /Applications/Xcode_11.6.app/Contents/Developer
if: matrix.swift == '5.2'
- name: Setup Swift 5.3
run: sudo xcode-select -s /Applications/Xcode_12_beta.app/Contents/Developer
if: matrix.swift == '5.3'
- name: Setup libsodium
run: brew install libsodium
- name: Run Tests
run: swift test -c release -Xswiftc -enable-testing
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

3 changes: 3 additions & 0 deletions Sources/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ let thermostat = ICYThermostat(info: .init(name: "Thermostaat", serialNumber: "1
let device = HAP.Device(setupCode: "123-44-321", storage: FileStorage(filename: "configuration.json"), accessory: thermostat)
let server = try HAP.Server(device: device, listenPort: 0)

//let speaker = Accessory(info: Service.Info(name: "My Speaker", serialNumber: "2"), type: .speaker, services: [Service.TelevisionSpeaker(name: "My Speaker")])
//let device = HAP.Device(bridgeInfo: Service.Info(name: "My Bridge", serialNumber: "0"), storage: FileStorage(filename: "configuration.json"),

var keepRunning = true
func stop() {
DispatchQueue.main.async {
Expand Down