Skip to content

Commit c359a75

Browse files
authored
Add swift test workflow (#51)
* Add swift test workflow * Fix swiftlint install by mint
1 parent cef9049 commit c359a75

File tree

6 files changed

+34
-11
lines changed

6 files changed

+34
-11
lines changed

.github/workflows/Danger.yml

+15-7
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ on: pull_request
44

55
jobs:
66
danger:
7-
87
runs-on: macos-latest
9-
108
steps:
119
- uses: actions/checkout@v2
1210
with:
@@ -28,13 +26,21 @@ jobs:
2826
restore-keys: |
2927
${{ runner.os }}-gem-
3028
31-
- name: Cache Mint packages
29+
- name: Cache Mint Builds
3230
uses: actions/cache@v1
3331
with:
3432
path: ${{ env.MINT_PATH }}
35-
key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
33+
key: ${{ runner.os }}-mint-build-${{ env.SWIFTLINT_VERSION }}
34+
restore-keys: |
35+
${{ runner.os }}-mint-build-
36+
37+
- name: Cache Mint Links
38+
uses: actions/cache@v1
39+
with:
40+
path: ${{ env.MINT_LINK_PATH }}
41+
key: ${{ runner.os }}-mint-link-${{ env.SWIFTLINT_VERSION }}
3642
restore-keys: |
37-
${{ runner.os }}-mint-
43+
${{ runner.os }}-mint-link-
3844
3945
- name: Bundle install
4046
run: |
@@ -45,12 +51,14 @@ jobs:
4551
- name: Install Mint and Packages
4652
run: |
4753
brew install mint
48-
mint bootstrap --link
54+
mint install realm/SwiftLint@${{ env.SWIFTLINT_VERSION }}
4955
5056
- name: Run Danger
5157
run: bundle exec danger
5258
env:
5359
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5460

5561
env:
56-
MINT_PATH: mint
62+
MINT_PATH: ${{ github.workspace }}/mint
63+
MINT_LINK_PATH: ${{ github.workspace }}/mint/bin
64+
SWIFTLINT_VERSION: 0.39.1

.github/workflows/Swift-Build.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Swift-Build
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: macos-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
with:
9+
submodules: recursive
10+
11+
- name: Xcode select
12+
run: sudo xcode-select -s /Applications/Xcode_11.4.app
13+
14+
- name: Build and Test
15+
run: |
16+
swift test

.github/workflows/CI.yml renamed to .github/workflows/Xcode-Build.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
name: CI
1+
name: Xcode-Build
22
on: [push, pull_request]
33
jobs:
44
test:
5-
65
runs-on: macos-latest
7-
86
steps:
97
- uses: actions/checkout@v2
108
with:

Dangerfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
github.dismiss_out_of_range_messages
22
swiftlint.config_file = '.swiftlint.yml'
3+
swiftlint.binary_path = './mint/bin/swiftlint'
34
swiftlint.lint_files(inline_mode: true)

Mintfile

-1
This file was deleted.

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# KeyHolder
2+
![CI](https://github.com/Clipy/KeyHolder/workflows/Xcode-Build/badge.svg)
23
[![Release version](https://img.shields.io/github/release/Clipy/KeyHolder.svg)](https://github.com/Clipy/KeyHolder/releases/latest)
34
[![License: MIT](https://img.shields.io/github/license/Clipy/KeyHolder.svg)](https://github.com/Clipy/KeyHolder/blob/master/LICENSE)
45
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)

0 commit comments

Comments
 (0)