-
-
Notifications
You must be signed in to change notification settings - Fork 2
131 lines (125 loc) · 4.25 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Build
on:
[push]
jobs:
linux-amd64:
name: Test jfuse-linux-amd64
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'zulu'
cache: 'maven'
- name: Setup fuse
run: |
sudo apt-get update
sudo apt-get install fuse3 libfuse3-dev
- name: Maven build
run: mvn -B verify -Dfuse.lib.path="/lib/x86_64-linux-gnu/libfuse3.so.3"
- uses: actions/upload-artifact@v3
with:
name: coverage-linux-amd64
path: jfuse-tests/target/site/jacoco-aggregate/jacoco.xml
retention-days: 3
mac:
name: Test jfuse-mac
runs-on: macos-12
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'zulu'
cache: 'maven'
- name: Setup fuse
run: |
brew tap macos-fuse-t/homebrew-cask
brew update
brew install fuse-t
- name: Maven build
run: mvn -B verify -Dfuse.lib.path="/usr/local/lib/libfuse-t.dylib"
- uses: actions/upload-artifact@v3
with:
name: coverage-mac
path: jfuse-tests/target/site/jacoco-aggregate/jacoco.xml
retention-days: 3
win:
name: Test jfuse-win
runs-on: windows-latest
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'zulu'
cache: 'maven'
- name: Setup fuse
run: choco install winfsp --version 1.12.22339 -y
- name: Maven build
shell: bash # surprise, running maven in pwsh is crappy, see https://stackoverflow.com/q/6347985/4014509
run: mvn -B verify -Dfuse.lib.path="C:\Program Files (x86)\WinFsp\bin\winfsp-x64.dll"
- uses: actions/upload-artifact@v3
with:
name: coverage-win
path: jfuse-tests/target/site/jacoco-aggregate/jacoco.xml
retention-days: 3
sonarcloud:
name: Run SonarCloud Analysis
needs: [linux-amd64, mac, win]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'zulu'
cache: 'maven'
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- uses: actions/download-artifact@v3
with:
name: coverage-linux-amd64
path: coverage/linux-amd64
- uses: actions/download-artifact@v3
with:
name: coverage-mac
path: coverage/mac
- uses: actions/download-artifact@v3
with:
name: coverage-win
path: coverage/win
- name: Analyze
run: >
mvn -B compile -DskipTests
org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
-Dsonar.projectKey=cryptomator_jfuse
-Dsonar.coverage.jacoco.xmlReportPaths=${GITHUB_WORKSPACE}/coverage/**/jacoco.xml
-Dsonar.organization=cryptomator
-Dsonar.host.url=https://sonarcloud.io
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
release:
needs: [ sonarcloud ]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Create Release
uses: actions/create-release@v1 #REMARK: action/create-release is unmaintend
env:
GITHUB_TOKEN: ${{ secrets.CRYPTOBOT_RELEASE_TOKEN }} # release as "cryptobot"
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
prerelease: true