-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
50 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
# 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: Swift | ||
name: CI (Pull Request) | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
branches: ["main"] | ||
|
||
jobs: | ||
# Taken from: | ||
# https://hoppsen.com/posts/unlock-the-secrets-of-swift-linting-with-swiftlint-and-swiftformat-on-github-actions/ | ||
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: | ||
|
@@ -24,7 +22,7 @@ jobs: | |
if [ -f ".build/release/swiftlint" ]; then | ||
sudo cp -f .build/release/swiftlint /usr/local/bin/swiftlint | ||
else | ||
git clone --depth 1 --branch $ https://github.com/realm/SwiftLint | ||
git clone --depth 1 https://github.com/realm/SwiftLint | ||
cd SwiftLint | ||
swift build --disable-sandbox -c release | ||
mv .build .. && cd .. | ||
|
@@ -41,12 +39,12 @@ jobs: | |
runs-on: macos-latest | ||
# https://github.com/slashmo/install-swift install specified swift version | ||
steps: | ||
- name: Install Swift | ||
uses: slashmo/[email protected] | ||
with: | ||
version: 5.5 | ||
- uses: actions/checkout@v3 | ||
- name: Build | ||
run: swift build -v | ||
- name: Run tests | ||
run: swift test -v | ||
- name: Install Swift | ||
uses: slashmo/[email protected] | ||
with: | ||
version: 5.5 | ||
- uses: actions/checkout@v3 | ||
- name: Build | ||
run: swift build -v | ||
- name: Run tests | ||
run: swift test -v |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# 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: | ||
- uses: actions/cache@v2 | ||
with: | ||
path: .build/release/swiftlint | ||
key: $-linting-swiftlint-$ | ||
- 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 --strict --config .swiftlint.yml --quiet | ||
env: | ||
LINUX_SOURCEKIT_LIB_PATH: /usr/share/swift/usr/lib |