Run commands first #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: ["pull_request", "push"] | |
env: | |
XCODE_VERSION: '15.0' | |
defaults: | |
run: | |
shell: bash | |
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 | |
- name: Configure project | |
run: | | |
swift package init --type executable | |
cp ../SwiftLintPlugins/.github/workflows/Package.swift . | |
echo "let myVar : Int = 0" > Sources/main.swift | |
working-directory: ./SwiftLintPluginsTest | |
- name: Verify command plugin | |
run: | | |
swift package swiftlint --help | |
swift package swiftlint --version | |
swift package swiftlint 2>&1 | grep -q "Colon Spacing Violation" | |
working-directory: ./SwiftLintPluginsTest | |
- name: Build project and check findings | |
run: | | |
swift build | |
swift build 2>&1 | grep -q "Colon Spacing Violation" | |
working-directory: ./SwiftLintPluginsTest |