Skip to content

Commit 7b6181b

Browse files
authored
Merge pull request #25 from taji-taji/support-linux
Support Linux
2 parents 12f3170 + ea5db3a commit 7b6181b

File tree

2 files changed

+40
-3
lines changed

2 files changed

+40
-3
lines changed

.github/workflows/test.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- main
88

99
jobs:
10-
build:
10+
macOS:
1111
strategy:
1212
fail-fast: false
1313
matrix:
@@ -20,8 +20,7 @@ jobs:
2020
- xcode: "13.2.1"
2121
macos: macos-12
2222
runs-on: ${{ matrix.macos }}
23-
env:
24-
GITHUB_TOKEN: ${{ secrets.DANGER_GITHUB_API_TOKEN }}
23+
name: macOS
2524
steps:
2625
- name: Checkout
2726
uses: actions/checkout@v2
@@ -44,4 +43,39 @@ jobs:
4443
${{ runner.os }}-dependencies-${{ matrix.xcode }}-
4544
- name: Test
4645
run: swift test
46+
linux:
47+
strategy:
48+
fail-fast: false
49+
matrix:
50+
swift: ["5.6", "5.5"]
51+
include:
52+
- swift: "5.6"
53+
container: "swift:5.6"
54+
cache-version: 2
55+
- swift: "5.5"
56+
container: "swift:5.5"
57+
cache-version: 2
58+
runs-on: ubuntu-latest
59+
container: ${{ matrix.container }}
60+
name: Linux
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v2
64+
- name: Get Swift Version
65+
id: get-swift-version
66+
run: |
67+
echo "::set-output name=version::$(swift -version | head -n 1 | sed s/,// )"
68+
shell: bash
69+
- name: Cache dependencies
70+
uses: actions/cache@v2
71+
with:
72+
path: |
73+
.build/artifacts
74+
.build/checkouts
75+
.build/repositories
76+
key: ${{ matrix.cache-version }}-${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}}-spm-deps-${{ hashFiles('Package.resolved') }}
77+
restore-keys: |
78+
${{ matrix.cache-version }}-${{ runner.os }}-${{ steps.get-swift-version.outputs.version }}-spm-deps-
79+
- name: Test
80+
run: swift test
4781

Sources/DangerSwiftPeriphery/CheckstyleOutputParser.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
//
77

88
import Foundation
9+
#if canImport(FoundationXML)
10+
import FoundationXML
11+
#endif
912

1013
protocol CheckstyleOutputParsable {
1114
func parse(xml: String) throws -> [Violation]

0 commit comments

Comments
 (0)