[misc] fix actions #3
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
# This workflow will build a Swift project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift | |
name: CI (Push) | |
on: push | |
jobs: | |
# Taken from: | |
# https://hoppsen.com/posts/unlock-the-secrets-of-swift-linting-with-swiftlint-and-swiftformat-on-github-actions/ | |
SwiftLint: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Build realm/SwiftLint | |
run: | | |
if [ -f ".build/release/swiftlint" ]; then | |
sudo cp -f .build/release/swiftlint /usr/local/bin/swiftlint | |
else | |
git clone --depth 1 https://github.com/realm/SwiftLint | |
cd SwiftLint | |
swift build --disable-sandbox -c release | |
mv .build .. && cd .. | |
rm -rf SwiftLint | |
sudo cp -f .build/release/swiftlint /usr/local/bin/swiftlint | |
fi | |
- name: SwiftLint | |
run: | | |
swiftlint --version | |
swiftlint lint --config .swiftlint.yml --strict --quiet | |
env: | |
LINUX_SOURCEKIT_LIB_PATH: /usr/share/swift/usr/lib |