Skip to content

Commit

Permalink
Merge pull request #378 from cclauss/patch-1
Browse files Browse the repository at this point in the history
+ GitHub Action to run swiftlint, swift build, and swift test
  • Loading branch information
buresdv authored Aug 19, 2024
2 parents 4e7e562 + 1c9bbc2 commit c80e3cb
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift

name: Swift
on: [push, pull_request]
jobs:
build:
name: Swift
runs-on: macos-latest
steps:
- run: brew install homebrew/cask/swift swiftlint
- uses: actions/checkout@v4
- run: swiftlint --version
- run: swiftlint --fix --quiet && git diff
- run: swiftlint --quiet | tee swiftlint.out.txt
- name: Failing SwiftLint rules
shell: python
run: |
with open("swiftlint.out.txt") as in_file:
errors = set(line.rsplit("(")[-1][:-2] for line in in_file if line.strip().endswith(")"))
print(f"{len(errors) = }\ndisabled_rules:")
print(" - " + "\n - ".join(sorted(errors)))
- run: swift build || true
- run: swift test || true

0 comments on commit c80e3cb

Please sign in to comment.