-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (43 loc) · 1.8 KB
/
macOS.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: macOS
on: [push]
jobs:
build:
env:
PACKAGE_NAME: Sappi
runs-on: macos-latest
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
xcode: ["/Applications/Xcode_11.5.app","/Applications/Xcode_11.6.app","/Applications/Xcode_11.7.app","/Applications/Xcode_12.app"]
steps:
- uses: actions/checkout@v2
- name: Set Xcode Name
run: echo "::set-env name=XCODE_NAME::$(basename -- ${{ matrix.xcode }} | sed 's/\.[^.]*$//' | cut -d'_' -f2)"
- name: Setup Xcode
run: sudo xcode-select -s ${{ matrix.xcode }}/Contents/Developer
- name: Installing Prerequisites
run: brew install mint && mint bootstrap
- name: Build
run: swift build
- name: Lint
run: mint run swiftformat --lint . && mint run swiftlint
- name: Run tests
run: swift test -v --enable-code-coverage
- name: Prepare Code Coverage
run: xcrun llvm-cov export -format="lcov" .build/debug/${{ env.PACKAGE_NAME }}PackageTests.xctest/Contents/MacOS/${{ env.PACKAGE_NAME }}PackageTests -instr-profile .build/debug/codecov/default.profdata > info.lcov
- name: Upload to CodeCov.io
run: bash <(curl https://codecov.io/bash) -F github -F macOS -n ${{ github.sha }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Build Documentation
if: ${{ matrix.xcode == '/Applications/Xcode_12.app' }}
run: mint run sourcedocs generate build -cra
- name: Commit files
if: ${{ matrix.xcode == '/Applications/Xcode_12.app' }}
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git status
git add Documentation
git diff-index --quiet HEAD || git commit -m "[github action] [ci skip] Update Docs"
git push