-
Notifications
You must be signed in to change notification settings - Fork 7
44 lines (40 loc) · 1.16 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Tests
on:
push:
branches:
- main
pull_request:
env:
XCODE_VERSION: '15.0'
defaults:
run:
working-directory: ./SwiftLintPluginsTest
jobs:
plugin:
name: Test Plugin
runs-on: macos-13
steps:
- name: Select Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{ env.XCODE_VERSION }}
- name: Checkout SwiftLintPlugins
uses: actions/checkout@v4
with:
path: SwiftLintPlugins
- name: Create project directory
run: mkdir SwiftLintPluginsTest
working-directory: .
- name: Configure project
run: |
swift package init --type executable
cp ../SwiftLintPlugins/.github/workflows/Package.swift .
echo "let myVar = 0 as! Int" > Sources/main.swift
echo "included: [Sources]" > .swiftlint.yml
- name: Build project and check findings
run: swift build 2>&1 | grep -q "Force Cast Violation"
- name: Verify command plugin
run: |
swift package swiftlint --version
swift package swiftlint --help
swift package swiftlint 2>&1 | grep -q "Force Cast Violation"