From cbc4fe77782974d4e8207d62e7d303861c04574b Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Fri, 18 Jan 2019 11:30:37 +0900 Subject: [PATCH 1/3] [Azure Pipelines] Use container shorthand and inline container https://docs.microsoft.com/en-us/azure/devops/release-notes/2018/sprint-143-update#declare-container-resources-inline --- azure-pipelines.yml | 45 +++++++++++---------------------------------- 1 file changed, 11 insertions(+), 34 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 306d0bc..32b57a1 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,26 +1,3 @@ -resources: - containers: - - container: '4.0.2' - image: norionomura/swiftlint:swift-4.0.2 - - container: '4.0.3' - image: norionomura/swiftlint:swift-4.0.3 - - container: '4.1.0' - image: norionomura/swiftlint:swift-4.1.0 - - container: '4.1.1' - image: norionomura/swiftlint:swift-4.1.1 - - container: '4.1.2' - image: norionomura/swiftlint:swift-4.1.2 - - container: '4.1.3' - image: norionomura/swiftlint:swift-4.1.3 - - container: '4.2.0' - image: norionomura/swiftlint:swift-4.2.0 - - container: '4.2.1' - image: norionomura/swiftlint:swift-4.2.1 - - container: '5.0' - image: norionomura/swift:swift-5.0-branch - - container: 'jazzy' - image: norionomura/jazzy:0.9.4_swift-4.2.1 - trigger: - master @@ -32,22 +9,22 @@ jobs: maxParallel: 10 matrix: swift402: - containerResource: '4.0.2' + containerImage: norionomura/swiftlint:swift-4.0.2 swift403: - containerResource: '4.0.3' + containerImage: norionomura/swiftlint:swift-4.0.3 swift410: - containerResource: '4.1.0' + containerImage: norionomura/swiftlint:swift-4.1.0 swift411: - containerResource: '4.1.1' + containerImage: norionomura/swiftlint:swift-4.1.1 swift412: - containerResource: '4.1.2' + containerImage: norionomura/swiftlint:swift-4.1.2 swift413: - containerResource: '4.1.3' + containerImage: norionomura/swiftlint:swift-4.1.3 swift420: - containerResource: '4.2.0' + containerImage: norionomura/swiftlint:swift-4.2.0 swift421: - containerResource: '4.2.1' - container: $[ variables['containerResource'] ] + containerImage: norionomura/swiftlint:swift-4.2.1 + container: $[ variables['containerImage'] ] steps: - script: swift test --parallel displayName: swift test with UTF16 @@ -70,7 +47,7 @@ jobs: - job: linux_swift50 pool: vmImage: 'Ubuntu 16.04' - container: '5.0' + container: norionomura/swift:swift-5.0-branch steps: - script: swift test --parallel displayName: swift test with UTF16 @@ -186,7 +163,7 @@ jobs: - job: jazzy pool: vmImage: 'Ubuntu 16.04' - container: 'jazzy' + container: norionomura/jazzy:0.9.4_swift-4.2.1 steps: - script: bundle install --path vendor/bundle displayName: bundle install From 07993a0ba2d629b27b5717d3f8942eae25f004a6 Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Fri, 18 Jan 2019 14:47:08 +0900 Subject: [PATCH 2/3] [Azure Pipelines] Use `DEVELOPER_DIR` environment variable instead of executing `xcode-select` That reduces some steps. --- azure-pipelines.yml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 32b57a1..69d105f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -65,26 +65,26 @@ jobs: maxParallel: 10 matrix: xcode901: - XCODE_APP: 'Xcode_9.0.1' + DEVELOPER_DIR: /Applications/Xcode_9.0.1.app xcode91: - XCODE_APP: 'Xcode_9.1' + DEVELOPER_DIR: /Applications/Xcode_9.1.app xcode92: - XCODE_APP: 'Xcode_9.2' + DEVELOPER_DIR: /Applications/Xcode_9.2.app xcode931: - XCODE_APP: 'Xcode_9.3.1' + DEVELOPER_DIR: /Applications/Xcode_9.3.1.app xcode941: - XCODE_APP: 'Xcode_9.4.1' + DEVELOPER_DIR: /Applications/Xcode_9.4.1.app xcode10: - XCODE_APP: 'Xcode_10' + DEVELOPER_DIR: /Applications/Xcode_10.app XCODE_FLAGS_FOR_TEST: -parallel-testing-enabled NO xcode101: - XCODE_APP: 'Xcode_10.1' + DEVELOPER_DIR: /Applications/Xcode_10.1.app XCODE_FLAGS_FOR_TEST: -parallel-testing-enabled NO steps: - script: | - sudo xcode-select -s /Applications/$XCODE_APP.app + xcodebuild -version echo "##vso[task.setvariable variable=XCODE_FLAGS]-scheme Yams $XCODE_FLAGS_FOR_TEST" - displayName: xcode-select & set XCODE_FLAGS + displayName: xcodebuild -version & set XCODE_FLAGS - script: > set -o pipefail && xcodebuild $XCODE_FLAGS test | @@ -141,18 +141,18 @@ jobs: - job: CocoaPods pool: vmImage: 'macOS 10.13' + variables: + DEVELOPER_DIR: /Applications/Xcode_9.4.1.app steps: - - script: sudo xcode-select -s /Applications/Xcode_9.4.1.app - displayName: xcode-select - script: pod lib lint displayName: pod lib lint - job: Analyze pool: vmImage: 'macOS 10.13' + variables: + DEVELOPER_DIR: /Applications/Xcode_10.1.app steps: - - script: sudo xcode-select -s /Applications/Xcode_10.1.app - displayName: xcode-select - script: xcodebuild -scheme Yams clean build-for-testing > xcodebuild.log displayName: Generate xcodebuild.log - script: HOMEBREW_NO_AUTO_UPDATE=1 brew install --HEAD https://raw.github.com/Homebrew/homebrew-core/master/Formula/swiftlint.rb From 3044bb8dbb725415045f9597d9b73b9d4faa194b Mon Sep 17 00:00:00 2001 From: Norio Nomura Date: Fri, 18 Jan 2019 15:08:55 +0900 Subject: [PATCH 3/3] Revert "Use SwiftLint HEAD to avoid false positives in unused_private_declaration" This reverts commit d1aa40536dd716e324cc1ce29e0855b043637c75. --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 69d105f..3065284 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -155,7 +155,7 @@ jobs: steps: - script: xcodebuild -scheme Yams clean build-for-testing > xcodebuild.log displayName: Generate xcodebuild.log - - script: HOMEBREW_NO_AUTO_UPDATE=1 brew install --HEAD https://raw.github.com/Homebrew/homebrew-core/master/Formula/swiftlint.rb + - script: HOMEBREW_NO_AUTO_UPDATE=1 brew install https://raw.github.com/Homebrew/homebrew-core/master/Formula/swiftlint.rb displayName: Install SwiftLint - script: swiftlint analyze --strict --compiler-log-path xcodebuild.log displayName: Run SwiftLint Analyze