mirror of
https://github.com/realm/SwiftLint.git
synced 2026-05-07 20:12:49 +00:00
Move more build steps into Makefile (#5975)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
# Run the commands in the Makefile for the specified rule.
|
||||
|
||||
parameters:
|
||||
- name: rule
|
||||
type: string
|
||||
|
||||
steps:
|
||||
- script: >-
|
||||
awk '
|
||||
$0 ~ "${{ parameters.rule }}:" { in_rule = 1; next }
|
||||
in_rule && /^\t/ { print $0 }
|
||||
in_rule && !/^\t/ { in_rule = 0 }
|
||||
' Makefile | while IFS= read -r command; do
|
||||
eval "$command"
|
||||
done
|
||||
displayName: Run `${{ parameters.rule }}` rule
|
||||
@@ -4,23 +4,21 @@ steps:
|
||||
- echo "+++ Build"
|
||||
- bazel build :swiftlint
|
||||
- echo "+++ Test"
|
||||
- bazel test --test_output=errors //Tests/...
|
||||
- make bazel_test
|
||||
- label: "SwiftPM"
|
||||
commands:
|
||||
- echo "+++ Test"
|
||||
- swift test --parallel -Xswiftc -DDISABLE_FOCUSED_EXAMPLES
|
||||
- make spm_test
|
||||
- label: "Danger"
|
||||
commands:
|
||||
- echo "--- Install Bundler"
|
||||
- echo "+++ Install Bundler"
|
||||
- gem install bundler -v 2.4.22
|
||||
- echo "--- Bundle Install"
|
||||
- bundle install
|
||||
- echo "+++ Run Danger"
|
||||
- bundle exec danger --verbose
|
||||
- echo "+++ Run OSS Scan"
|
||||
- make oss_scan
|
||||
- label: "TSan Tests"
|
||||
commands:
|
||||
- echo "+++ Test"
|
||||
- bazel test --test_output=errors --build_tests_only --features=tsan --test_timeout=1000 //Tests/...
|
||||
- make bazel_test_tsan
|
||||
- label: "Sourcery"
|
||||
commands:
|
||||
- echo "+++ Run Sourcery"
|
||||
|
||||
@@ -53,6 +53,13 @@ test_tsan:
|
||||
swift build --build-tests $(TSAN_SWIFT_BUILD_FLAGS)
|
||||
DYLD_INSERT_LIBRARIES=$(TSAN_LIB) $(TSAN_XCTEST) $(TSAN_TEST_BUNDLE)
|
||||
|
||||
spm_build_plugins:
|
||||
swift build -c release --product SwiftLintCommandPlugin
|
||||
swift build -c release --product SwiftLintBuildToolPlugin
|
||||
|
||||
spm_test:
|
||||
swift test --parallel -Xswiftc -DDISABLE_FOCUSED_EXAMPLES
|
||||
|
||||
write_xcodebuild_log:
|
||||
xcodebuild -scheme swiftlint clean build-for-testing -destination "platform=macOS" > xcodebuild.log
|
||||
|
||||
@@ -147,6 +154,9 @@ package: $(SWIFTLINT_EXECUTABLE)
|
||||
bazel_test:
|
||||
bazel test --test_output=errors //Tests/...
|
||||
|
||||
bazel_test_tsan:
|
||||
bazel test --test_output=errors --build_tests_only --features=tsan --test_timeout=1000 //Tests/...
|
||||
|
||||
bazel_release: $(SWIFTLINT_EXECUTABLE)
|
||||
bazel build :release
|
||||
mv -f bazel-bin/bazel.tar.gz bazel-bin/bazel.tar.gz.sha256 $(SWIFTLINT_EXECUTABLE) .
|
||||
@@ -167,17 +177,20 @@ display_compilation_time:
|
||||
formula_bump:
|
||||
brew update && brew bump-formula-pr --tag=$(shell git describe --tags) --revision=$(shell git rev-parse HEAD) swiftlint
|
||||
|
||||
pod_publish:
|
||||
bundle_install:
|
||||
bundle install
|
||||
|
||||
oss_scan: bundle_install
|
||||
bundle exec danger --verbose
|
||||
|
||||
pod_publish: bundle_install
|
||||
bundle exec pod trunk push SwiftLint.podspec
|
||||
|
||||
pod_lint:
|
||||
bundle install
|
||||
pod_lint: bundle_install
|
||||
bundle exec pod lib lint --verbose SwiftLint.podspec
|
||||
|
||||
docs:
|
||||
docs: bundle_install
|
||||
swift run swiftlint generate-docs
|
||||
bundle install
|
||||
bundle exec jazzy
|
||||
|
||||
get_version:
|
||||
|
||||
+8
-12
@@ -11,8 +11,9 @@ jobs:
|
||||
vmImage: 'ubuntu-24.04' # "Noble Numbat"
|
||||
container: swift:6.0-noble
|
||||
steps:
|
||||
- script: swift test --parallel -Xswiftc -DDISABLE_FOCUSED_EXAMPLES
|
||||
displayName: Run tests
|
||||
- template: .azure/templates/run-make.yml
|
||||
parameters:
|
||||
rule: spm_test
|
||||
|
||||
- job: bazel_linux
|
||||
displayName: 'Bazel, Linux : Swift 6'
|
||||
@@ -47,7 +48,7 @@ jobs:
|
||||
variables:
|
||||
DEVELOPER_DIR: /Applications/Xcode_$(xcode).app
|
||||
steps:
|
||||
- script: swift test --parallel -Xswiftc -DDISABLE_FOCUSED_EXAMPLES
|
||||
- script: make spm_test
|
||||
displayName: Run tests
|
||||
|
||||
- job: plugins_linux # Plugins shall be able to run on older Swift versions.
|
||||
@@ -65,10 +66,9 @@ jobs:
|
||||
image: swift:6.0-noble
|
||||
container: $[ variables['image'] ]
|
||||
steps:
|
||||
- script: swift build -c release --product SwiftLintCommandPlugin
|
||||
displayName: Build command plugin
|
||||
- script: swift build -c release --product SwiftLintBuildToolPlugin
|
||||
displayName: Build build tool plugin
|
||||
- template: .azure/templates/run-make.yml
|
||||
parameters:
|
||||
rule: spm_build_plugins
|
||||
|
||||
- job: Jazzy
|
||||
pool:
|
||||
@@ -76,11 +76,7 @@ jobs:
|
||||
variables:
|
||||
DEVELOPER_DIR: /Applications/Xcode_15.4.app
|
||||
steps:
|
||||
- script: swift run swiftlint generate-docs
|
||||
displayName: Generate documentation
|
||||
- script: bundle install --path vendor/bundle
|
||||
displayName: Install dependencies
|
||||
- script: bundle exec jazzy
|
||||
- script: make docs
|
||||
displayName: Run Jazzy
|
||||
- script: >
|
||||
if ruby -rjson -e "j = JSON.parse(File.read('docs/undocumented.json')); exit j['warnings'].length != 0"; then
|
||||
|
||||
Reference in New Issue
Block a user