Move remaining CI jobs to GitHub Actions (#3822)
Analyze, TSan, Xcode & Docs
This commit is contained in:
parent
006bb2a85e
commit
4525e9999b
|
@ -0,0 +1,54 @@
|
|||
name: Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: ['*']
|
||||
|
||||
jobs:
|
||||
Docs:
|
||||
runs-on: macos-latest
|
||||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: bundle install
|
||||
run: bundle install
|
||||
- name: Run swiftlint generate-docs
|
||||
run: swift run swiftlint generate-docs
|
||||
- name: Run jazzy
|
||||
run: bundle exec jazzy
|
||||
- name: Validate documentation coverage
|
||||
run: |
|
||||
if ruby -rjson -e "j = JSON.parse(File.read('docs/undocumented.json')); exit j['warnings'].length != 0"; then
|
||||
echo "Undocumented declarations:"
|
||||
cat docs/undocumented.json
|
||||
exit 1
|
||||
fi
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: API Docs
|
||||
path: docs
|
||||
- name: Push to gh-pages
|
||||
if: github.event_name == 'push'
|
||||
run: |
|
||||
git config --global user.email "${GITHUB_ACTOR}"
|
||||
git config --global user.name "${GITHUB_ACTOR}@users.noreply.github.com"
|
||||
git clone "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" out
|
||||
|
||||
cd out
|
||||
git checkout gh-pages
|
||||
git rm -rf .
|
||||
cd ..
|
||||
|
||||
cp -a docs/. out/.
|
||||
cd out
|
||||
|
||||
git add -A
|
||||
git commit -m "Automated deployment to GitHub Pages: ${GITHUB_SHA}" --allow-empty
|
||||
|
||||
git push origin gh-pages
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -0,0 +1,22 @@
|
|||
name: TSan
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: ['*']
|
||||
|
||||
jobs:
|
||||
tsan:
|
||||
name: TSan
|
||||
runs-on: macos-latest
|
||||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: swift run --sanitize=thread swiftlint lint --lenient
|
||||
name: Pre-cache SwiftLint Run
|
||||
- run: swift run --sanitize=thread swiftlint lint --lenient
|
||||
name: Post-cache SwiftLint Run
|
||||
- run: make test_tsan
|
||||
name: Test With TSan
|
|
@ -0,0 +1,24 @@
|
|||
name: xcodebuild
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: ['*']
|
||||
|
||||
jobs:
|
||||
Xcode:
|
||||
strategy:
|
||||
matrix:
|
||||
xcode_version: ['12.5.1', '13.0', '13.2.1']
|
||||
runs-on: macos-11
|
||||
env:
|
||||
DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode_version }}.app
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- run: xcodebuild -scheme swiftlint test -destination "platform=macOS" | xcpretty -r junit -o build/reports/xcodebuild.xml
|
||||
name: xcodebuild test
|
||||
- run: bash <(curl -s https://codecov.io/bash)
|
||||
name: Export code coverage
|
||||
if: matrix.xcode_version == '13.2.1'
|
||||
env: { 'CODECOV_TOKEN': '${{ secrets.CODECOV_TOKEN }}' }
|
10
README.md
10
README.md
|
@ -7,8 +7,14 @@ SwiftLint hooks into [Clang](http://clang.llvm.org) and
|
|||
[AST](http://clang.llvm.org/docs/IntroductionToTheClangAST.html) representation
|
||||
of your source files for more accurate results.
|
||||
|
||||
[](https://dev.azure.com/jpsim/SwiftLint/_build/latest?definitionId=4?branchName=master)
|
||||
[](https://codecov.io/github/realm/SwiftLint?branch=master)
|
||||
[](https://github.com/realm/SwiftLint/actions/workflows/analyze.yml)
|
||||
[](https://github.com/realm/SwiftLint/actions/workflows/pod_lib_lint.yml)
|
||||
[](https://github.com/realm/SwiftLint/actions/workflows/docker.yml)
|
||||
[](https://github.com/realm/SwiftLint/actions/workflows/docs.yml)
|
||||
[](https://github.com/realm/SwiftLint/actions/workflows/swiftpm.yml)
|
||||
[](https://github.com/realm/SwiftLint/actions/workflows/tsan.yml)
|
||||
[](https://github.com/realm/SwiftLint/actions/workflows/xcodebuild.yml)
|
||||
[](https://codecov.io/gh/realm/SwiftLint)
|
||||
|
||||

|
||||
|
||||
|
|
|
@ -1,75 +0,0 @@
|
|||
trigger:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
- job: Xcode
|
||||
pool:
|
||||
vmImage: 'macOS-11'
|
||||
strategy:
|
||||
maxParallel: 10
|
||||
matrix:
|
||||
xcode125:
|
||||
DEVELOPER_DIR: /Applications/Xcode_12.5.1.app
|
||||
xcode13:
|
||||
DEVELOPER_DIR: /Applications/Xcode_13.0.app
|
||||
steps:
|
||||
- script: |
|
||||
sw_vers
|
||||
xcodebuild -version
|
||||
displayName: Version Informations
|
||||
- script: >
|
||||
set -o pipefail &&
|
||||
xcodebuild -scheme swiftlint test -destination "platform=macOS" |
|
||||
xcpretty -r junit -o build/reports/xcodebuild.xml
|
||||
displayName: xcodebuild test
|
||||
- script: bash <(curl -s https://codecov.io/bash)
|
||||
displayName: Export code coverage
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testRunner: JUnit
|
||||
testResultsFiles: build/reports/**
|
||||
condition: succeededOrFailed()
|
||||
|
||||
- job: TSan
|
||||
pool:
|
||||
vmImage: 'macOS-11'
|
||||
variables:
|
||||
DEVELOPER_DIR: /Applications/Xcode_13.0.app
|
||||
steps:
|
||||
- script: swift run --sanitize=thread swiftlint lint --lenient
|
||||
displayName: Pre-cache SwiftLint Run
|
||||
- script: swift run --sanitize=thread swiftlint lint --lenient
|
||||
displayName: Post-cache SwiftLint Run
|
||||
- script: make test_tsan
|
||||
displayName: Test With TSan
|
||||
|
||||
- job: jazzy
|
||||
pool:
|
||||
vmImage: 'macOS-11'
|
||||
variables:
|
||||
DEVELOPER_DIR: /Applications/Xcode_13.2.1.app
|
||||
steps:
|
||||
- script: swift run swiftlint generate-docs
|
||||
displayName: Run swiftlint generate-docs
|
||||
- script: bundle install --path vendor/bundle
|
||||
displayName: bundle install
|
||||
- script: bundle exec jazzy
|
||||
displayName: Run jazzy
|
||||
- script: >
|
||||
if ruby -rjson -e "j = JSON.parse(File.read('docs/undocumented.json')); exit j['warnings'].length != 0"; then
|
||||
echo "Undocumented declarations:"
|
||||
cat docs/undocumented.json
|
||||
exit 1
|
||||
fi
|
||||
displayName: Validate documentation coverage
|
||||
- task: PublishPipelineArtifact@0
|
||||
inputs:
|
||||
artifactName: 'API Docs'
|
||||
targetPath: 'docs'
|
||||
- task: DownloadSecureFile@1
|
||||
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
||||
inputs:
|
||||
secureFile: doc_deploy_key
|
||||
- script: ./script/push-docs
|
||||
displayName: Publish
|
||||
condition: eq(variables['Build.SourceBranch'], 'refs/heads/master')
|
|
@ -1,25 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
mkdir -p ~/.ssh && mv $DOWNLOADSECUREFILE_SECUREFILEPATH ~/.ssh/id_rsa
|
||||
chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa
|
||||
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
|
||||
|
||||
source_sha="$(git rev-parse HEAD)"
|
||||
user="swiftlintbot@jpsim.com"
|
||||
git config --global user.email "$user"
|
||||
git config --global user.name "$user"
|
||||
git clone git@github.com:realm/SwiftLint.git out
|
||||
|
||||
cd out
|
||||
git checkout gh-pages
|
||||
git rm -rf .
|
||||
rm -rf Carthage
|
||||
cd ..
|
||||
|
||||
cp -a docs/. out/.
|
||||
cd out
|
||||
|
||||
git add -A
|
||||
git commit -m "Automated deployment to GitHub Pages: ${source_sha}" --allow-empty
|
||||
|
||||
git push origin gh-pages
|
Loading…
Reference in New Issue