-
Notifications
You must be signed in to change notification settings - Fork 1
105 lines (81 loc) · 2.63 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
name: build
on:
push:
branches:
- '**'
env:
DOTNET_NOLOGO: true
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
test-java:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: build
shell: pwsh
run: ./tools/build-java.ps1
test-dotnet:
runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy:
# fail-fast: false
matrix:
os:
- ubuntu-latest
# - macos-latest Doesn't work yet
- windows-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
- uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0
with:
dotnet-version: |
6
8
dotnet-quality: ga
- name: prepare
run: dotnet restore
- name: tfm
# building net461 doesn't work on non windows
if: matrix.os != 'windows-latest'
run: echo "NoNet4=true" >> $GITHUB_ENV
- name: build
run: dotnet build --no-restore
- name: test
run: dotnet test --no-build
- name: Codecov
uses: codecov/codecov-action@13ce06bfc6bbe3ecf90edbbf1bc32fe5978ca1d3 # v5.3.1
with:
files: '**/TestResults/*/*.cobertura.xml'
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
build:
runs-on: windows-latest
timeout-minutes: 15
needs: [test-java, test-dotnet]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
with:
path: ~/.nuget/packages
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
- name: prepare
run: dotnet restore
- name: build
run: dotnet build --no-restore -c Release
- name: pack
run: dotnet pack --no-build -o bin -c Release
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: packages
path: bin/*.nupkg