Skip to content

Create new CI file #27

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI

on:
pull_request:
push:
branches:
- main
- master

jobs:
test-on-macos-11:
name: Test on macOS 11
runs-on: macOS-11
strategy:
matrix:
xcode: ["12.4", "12.5.1", "13.0"]
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: gem install bundler
- run: bundle install
- run: xcodebuild test -scheme DangerXCodeSummary-Package -derivedDataPath Build/ -enableCodeCoverage YES | XCPRETTY_JSON_FILE_OUTPUT=result.json xcpretty -f `xcpretty-json-formatter`

- run: swift run danger-swift ci --verbose --failOnErrors
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

test-on-linux:
name: Test on Linux
runs-on: ubuntu-latest
strategy:
matrix:
swift: ["5.3.3", "5.5.2"]
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: gem install bundler
- run: bundle install
- run: swift test | XCPRETTY_JSON_FILE_OUTPUT=result.json xcpretty -f `xcpretty-json-formatter`

- run: swift run danger-swift ci --verbose --failOnErrors
if: ${{ github.event_name == 'pull_request' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 14 additions & 14 deletions Package.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/f-meloni/danger-swift-coverage",
"state": {
"branch": null,
"revision": "f8dbe265ea8d8d2936d861bff10ea280b742d237",
"version": "1.1.0"
"revision": "6a21a6e595e2b13443428942ce128b3ba6b827ee",
"version": "1.2.1"
}
},
{
Expand All @@ -24,17 +24,17 @@
"repositoryURL": "https://github.com/nerdishbynature/octokit.swift",
"state": {
"branch": null,
"revision": "c391cfba4d33f3f4c7d7d8fa6708970f7d30af82",
"version": "0.10.1"
"revision": "9521cdff919053868ab13cd08a228f7bc1bde2a9",
"version": "0.11.0"
}
},
{
"package": "PackageConfig",
"repositoryURL": "https://github.com/shibapm/PackageConfig.git",
"state": {
"branch": null,
"revision": "bf90dc69fa0792894b08a0b74cf34029694ae486",
"version": "0.13.0"
"revision": "58523193c26fb821ed1720dcd8a21009055c7cdb",
"version": "1.1.3"
}
},
{
Expand All @@ -51,26 +51,26 @@
"repositoryURL": "https://github.com/f-meloni/Rocket",
"state": {
"branch": null,
"revision": "61166b38e229e09b53becef2e495eb99f437438a",
"version": "1.0.1"
"revision": "9880a5beb7fcb9e61ddd5764edc1700b8c418deb",
"version": "1.2.1"
}
},
{
"package": "danger-swift",
"repositoryURL": "https://github.com/danger/swift",
"state": {
"branch": null,
"revision": "b8edc077a0a5b27919ef586d1ee3cea908fa154e",
"version": "3.3.1"
"revision": "c1bba33f705ca0fd4a0022997c8b696210083755",
"version": "3.12.3"
}
},
{
"package": "SwiftShell",
"repositoryURL": "https://github.com/kareman/SwiftShell",
"state": {
"branch": null,
"revision": "fb7fc2c9ad8811caf324431a508fb79e3fb74f99",
"version": "5.0.1"
"revision": "a6014fe94c3dbff0ad500e8da4f251a5d336530b",
"version": "5.1.0-beta.1"
}
},
{
Expand All @@ -87,8 +87,8 @@
"repositoryURL": "https://github.com/jpsim/Yams",
"state": {
"branch": null,
"revision": "c947a306d2e80ecb2c0859047b35c73b8e1ca27f",
"version": "2.0.0"
"revision": "9ff1cc9327586db4e0c8f46f064b6a82ec1566fa",
"version": "4.0.6"
}
}
]
Expand Down