Migrate CI to GitHub Actions, test on Linux

This commit is contained in:
Max Desiatov 2020-06-10 18:26:43 +01:00
parent c5743c6437
commit 5e85356a1c
No known key found for this signature in database
GPG Key ID: FE08EBF9CF58CBA2
9 changed files with 76 additions and 40 deletions

22
.github/workflows/danger.yml vendored Normal file
View File

@ -0,0 +1,22 @@
# This is a basic workflow to help you get started with Actions
name: Danger
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
pull_request:
branches: [master]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
danger-lint:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Danger Swift
uses: maxdesiatov/danger-swift@swiftlint-docker
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

30
.github/workflows/swift.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Build and test
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
macos_build:
runs-on: macos-10.15
steps:
- uses: actions/checkout@v2
- name: Build
shell: bash
run: |
set -x
./test.sh
./codecov.sh
linux_build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Test on Ubuntu with Swift 5.2
uses: Didstopia/SwiftAction@v1.0.2
with:
swift-action: test --enable-test-discovery

17
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "swift build",
"type": "shell",
"command": "swift build"
},
{
"label": "swift test",
"type": "shell",
"command": "swift test"
}
]
}

View File

@ -1,4 +1,4 @@
// swift-tools-version:5.1
// swift-tools-version:5.2
// The swift-tools-version declares the minimum version of Swift required to
// build this package.

View File

@ -1,7 +0,0 @@
import XCTest
import TokamakTests
var tests = [XCTestCaseEntry]()
tests += TokamakTests.allTests()
XCTMain(tests)

View File

@ -1,19 +0,0 @@
trigger:
- master
jobs:
- job: lint
pool:
vmImage: "macOS-10.15"
steps:
- bash: ./lint.sh
- job: test
pool:
vmImage: "macOS-10.15"
steps:
- bash: ./test.sh
- bash: ./codecov.sh
env:
CODECOV_TOKEN: $(codecovToken)
condition: succeeded()

View File

@ -1,6 +1,5 @@
#!/bin/bash
set -e
set -o pipefail
set -ex
bash <(curl -s https://codecov.io/bash)

View File

@ -1,9 +0,0 @@
#!/bin/bash
set -ex
brew update
brew install swiftformat swiftlint
swiftformat --lint --verbose .
swiftlint

View File

@ -2,4 +2,7 @@
set -ex
swift test
swift test --enable-code-coverage
xcrun llvm-cov show \
.build/debug/TokamakPackageTests.xctest/Contents/MacOS/TokamakPackageTests \
-instr-profile=.build/debug/codecov/default.profdata > coverage.txt