-
Notifications
You must be signed in to change notification settings - Fork 7
55 lines (52 loc) · 1.8 KB
/
build.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
49
50
51
52
53
54
55
name: Build
on:
push:
pull_request_target:
types: [labeled]
jobs:
build:
name: Build and test
runs-on: macos-12
env:
DERIVED_DATA_PATH: 'DerivedData'
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: .build
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-
- name: Run process.sh script
run: |
./Scripts/process.sh
exit $?
- name: Build and test
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -scheme 'CryptomatorCryptoLib' -destination 'platform=macOS' -derivedDataPath $DERIVED_DATA_PATH -enableCodeCoverage YES clean test | xcpretty
- name: Upload code coverage report
run: |
gem install slather
slather coverage -x --build-directory $DERIVED_DATA_PATH --ignore "$DERIVED_DATA_PATH/SourcePackages/*" --scheme CryptomatorCryptoLib CryptomatorCryptoLib.xcodeproj
bash <(curl -Ls https://coverage.codacy.com/get.sh)
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
continue-on-error: true
release:
name: Deploy and draft a release
runs-on: macos-12
needs: build
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- name: Draft release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
:construction: Work in Progress
draft: true
prerelease: false