Skip to content

Commit

Permalink
fix: build phases and lint scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
mflknr committed Jun 14, 2024
1 parent 3b38e08 commit 6326516
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
pull_request:
branches: [ "main", "develop" ]

env:
CI: true

jobs:
build:
runs-on: macos-latest
Expand Down Expand Up @@ -40,7 +43,7 @@ jobs:
version: 2024.6.3
install: true
cache: true
- run: make lint-swiftlint
- run: make ci-lint-swiftlint

lint-swiftformat:
runs-on: macos-latest
Expand All @@ -51,4 +54,4 @@ jobs:
version: 2024.6.3
install: true
cache: true
- run: make lint-strict-swiftformat
- run: make ci-lint-swiftformat
20 changes: 11 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
CONFIG = debug
MISE = ~/.local/bin/mise

prepare:
tuist install && tuist generate -n

build:
tuist build Debug --clean --no-binary-cache

local-lint-swiftlint:
~/.local/bin/mise x swiftlint@latest -- swiftlint Sources/ --config .swiftlint.yml

local-lint-swiftformat:
~/.local/bin/mise x swiftformat@latest -- swiftformat Sources/ --lint --lenient

test:
tuist test

format:
$(MISE) x swiftformat@latest -- swiftformat Sources/

lint-swiftlint:
$(MISE) x swiftlint@latest -- swiftlint Sources/ --config .swiftlint.yml
mise x swiftformat@latest -- swiftformat Sources/

lint-swiftformat:
$(MISE) x swiftformat@latest -- swiftformat Sources/ --lint --lenient
ci-lint-swiftlint:
mise x swiftlint@latest -- swiftlint lint Sources/ --config .swiftlint.yml --strict

lint-strict-swiftformat:
$(MISE) x swiftformat@latest -- swiftformat Sources/ --lint --strict
ci-lint-swiftformat:
mise x swiftformat@latest -- swiftformat Sources/ --lint --strict
4 changes: 2 additions & 2 deletions Tuist/ProjectDescriptionHelpers/ScriptPhases.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ extension Project {
.post(
script: """
if [[ -z ${CI} ]] ; then
make lint-swiftlint
make local-lint-swiftlint
else
echo "Skipping SwiftLint build phase on pipeline. Local build phase only."
exit 0
Expand All @@ -24,7 +24,7 @@ extension Project {
.post(
script: """
if [[ -z ${CI} ]] ; then
make lint-swiftformat
make local-lint-swiftformat
else
echo "Skipping SwiftFormat build phase on pipeline. Local build phase only."
exit 0
Expand Down

0 comments on commit 6326516

Please sign in to comment.