Use repository owner as commit author #50
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: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
XCODE_VERSION: '15.0' | |
defaults: | |
run: | |
working-directory: ./SwiftLintPluginsTest | |
jobs: | |
plugin: | |
name: Test Plugins | |
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: Let build fail | |
id: failed_build | |
run: swift build | |
continue-on-error: true | |
- name: Verify that build failed | |
if: ${{ steps.failed_build.outcome != 'failure' }} | |
run: exit 1 | |
- name: Let command fail | |
id: failed_command | |
run: swift package plugin --allow-writing-to-package-directory swiftlint | |
continue-on-error: true | |
- name: Verify that command failed | |
if: ${{ steps.failed_command.outcome != 'failure' }} | |
run: exit 1 | |
- name: Let Xcode build fail | |
id: failed_xcode_build | |
run: xcodebuild -scheme SwiftLintPluginsTest -destination 'platform=macOS' -skipPackagePluginValidation build | |
continue-on-error: true | |
- name: Verify that Xcode build failed | |
if: ${{ steps.failed_xcode_build.outcome != 'failure' }} | |
run: exit 1 | |
- name: Change to warning | |
run: | | |
echo "force_cast: warning" > .swiftlint.yml | |
- name: Check that all commands pass | |
run: | | |
swift package plugin --allow-writing-to-package-directory swiftlint | grep -q "Force Cast Violation" | |
xcodebuild -scheme SwiftLintPluginsTest -destination 'platform=macOS' -skipPackagePluginValidation build | grep -q "Force Cast Violation" |