Prevent empty SwiftLint violation response from failure #456
Workflow file for this run
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
name: CI | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- master | |
concurrency: | |
group: ${{ github.ref }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
test-on-macos-12: | |
name: Test on macOS 12 | |
runs-on: macOS-12 | |
strategy: | |
fail-fast: false | |
matrix: | |
xcode: ["13.2.1", "13.4.1", "14.1"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
.build/artifacts | |
.build/checkouts | |
.build/repositories | |
key: ${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }} | |
restore-keys: | | |
${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }} | |
${{ runner.os }}-dependencies-${{ matrix.xcode }}- | |
- name: Select Xcode | |
run: | | |
xcodebuild -version | |
ls -nt /Applications/ | grep "Xcode*" | |
sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app | |
xcodebuild -version | |
- name: Install danger-js | |
run: brew install danger/tap/danger-js | |
- run: swift test | |
- run: swift run danger-swift ci --verbose --failOnErrors | |
if: ${{ github.event_name == 'pull_request' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
test-dependencies-resolver: | |
name: Test dependencies resolver | |
runs-on: macOS-12 | |
strategy: | |
fail-fast: false | |
matrix: | |
xcode: ["13.2.1", "13.4.1", "14.1"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
.build/artifacts | |
.build/checkouts | |
.build/repositories | |
key: ${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }} | |
restore-keys: | | |
${{ runner.os }}-dependencies-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }} | |
${{ runner.os }}-dependencies-${{ matrix.xcode }}- | |
- name: Select Xcode | |
run: | | |
xcodebuild -version | |
ls -nt /Applications/ | grep "Xcode*" | |
sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app | |
xcodebuild -version | |
- name: Install danger-js | |
run: brew install danger/tap/danger-js | |
- run: make install | |
- run: mkdir DangerTestWithDependencies && mv DangerfileWithDependencies.swift DangerTestWithDependencies/Dangerfile.swift | |
- run: cd DangerTestWithDependencies && danger-swift ci --verbose --failOnErrors --id DangerDependencies | |
if: ${{ github.event_name == 'pull_request' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
test-on-linux: | |
name: Test on Linux | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
swift: ["5.5.3", "5.6.3", "5.7"] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
.build/artifacts | |
.build/checkouts | |
.build/repositories | |
key: ${{ runner.os }}-dependencies-${{ matrix.swift }}-${{ hashFiles('**/Package.resolved') }} | |
restore-keys: | | |
${{ runner.os }}-dependencies-${{ matrix.swift }}-${{ hashFiles('**/Package.resolved') }} | |
${{ runner.os }}-dependencies-${{ matrix.swift }}- | |
- name: Install danger-js | |
run: | | |
yarn global add danger | |
echo `yarn global bin` >> $GITHUB_PATH | |
- run: echo ${{ matrix.swift }} > .swift-version | |
- uses: YOCKOW/Action-setup-swift@v1 | |
- run: swift test --enable-test-discovery | |
- run: swift run danger-swift ci --verbose --failOnErrors | |
if: ${{ github.event_name == 'pull_request' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
test-without-spm-on-macos-12: | |
name: Test without SPM on macOS 12 | |
runs-on: macOS-12 | |
strategy: | |
fail-fast: false | |
matrix: | |
xcode: ["13.2.1", "13.4.1", "14.1"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
.build/artifacts | |
.build/checkouts | |
.build/repositories | |
key: ${{ runner.os }}-without-spm-package-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }} | |
restore-keys: | | |
${{ runner.os }}-without-spm-package-${{ matrix.xcode }}-${{ hashFiles('**/Package.resolved') }} | |
${{ runner.os }}-without-spm-package-${{ matrix.xcode }}- | |
- name: Select Xcode | |
run: | | |
xcodebuild -version | |
ls -nt /Applications/ | grep "Xcode*" | |
sudo xcode-select -switch /Applications/Xcode_${{ matrix.xcode }}.app | |
xcodebuild -version | |
- name: Install danger-js | |
run: brew install danger/tap/danger-js | |
- run: make install | |
- run: danger-swift ci --verbose --failOnErrors | |
if: ${{ github.event_name == 'pull_request' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
test-without-spm-on-linux: | |
name: Test without SPM on Linux | |
runs-on: ubuntu-20.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
swift: ["5.5.3", "5.6.3", "5.7"] | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
with: | |
path: | | |
.build/artifacts | |
.build/checkouts | |
.build/repositories | |
key: ${{ runner.os }}-without-spm-package-${{ matrix.swift }}-${{ hashFiles('**/Package.resolved') }} | |
restore-keys: | | |
${{ runner.os }}-without-spm-package-${{ matrix.swift }}-${{ hashFiles('**/Package.resolved') }} | |
${{ runner.os }}-without-spm-package-${{ matrix.swift }}- | |
- name: Install danger-js | |
run: | | |
yarn global add danger | |
echo `yarn global bin` >> $GITHUB_PATH | |
- run: echo ${{ matrix.swift }} > .swift-version | |
- uses: YOCKOW/Action-setup-swift@v1 | |
- run: sudo chmod -R a+rwx /usr/local | |
- run: make install | |
- run: danger-swift ci --verbose --failOnErrors | |
if: ${{ github.event_name == 'pull_request' }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |