-
Notifications
You must be signed in to change notification settings - Fork 4
165 lines (145 loc) · 5.46 KB
/
build-test-docs-publish.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# note, the nuget org token expires around June 2021
name: Build, test, generate docs, publish
on:
push:
branches:
- dev
tags:
- v* # Push events to v1.2.3 tag
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install SkiaSharp Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libfontconfig1
sudo apt-get install -y libharfbuzz0b
sudo apt-get install -y libicu-dev
sudo apt-get install -y libfreetype6
sudo apt-get install -y libgif-dev
sudo apt-get install -y libjpeg-dev
sudo apt-get install -y libpng-dev
sudo apt-get install -y libtiff-dev
- name: Setup dotnet 6.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: dotnet restore
- name: Install tool dependencies
run: dotnet tool restore
# Release build is used to prepare packages
- name: Build (Release)
run: dotnet build --configuration Release --no-restore --verbosity normal
# Debug build is used to prepare docs
- name: Build (Debug)
run: dotnet build --configuration Debug --no-restore --verbosity normal
- name: Get git commit info
run: |
echo "GIT_COMMIT_AUTHOR=$(git log -1 --pretty=%cn)" >> $GITHUB_ENV
echo "GIT_COMMIT_AUTHOR_EMAIL=$(git log -1 --pretty=%ce)" >> $GITHUB_ENV
echo "GIT_COMMIT_MESSAGE=$(git log -1 --pretty=%s)" >> $GITHUB_ENV
- name: Install ReportGenerator
run: dotnet tool install -g dotnet-reportgenerator-globaltool --version 5.1.26
- name: Test with coverage
run: |
# Create coverage directory
mkdir -p coverage
# Run tests with coverage and debug output
dotnet test --configuration Release --no-build \
/p:CollectCoverage=true \
/p:CoverletOutputFormat=opencover \
/p:CoverletOutput="$PWD/coverage/coverage.opencover.xml" \
- name: Process coverage
run: |
# Convert to LCOV format
reportgenerator \
-reports:"$PWD/coverage/coverage.opencover.xml" \
-targetdir:"$PWD/coverage" \
-reporttypes:lcov
- name: Upload coverage
uses: coverallsapp/github-action@v2
with:
file: coverage/lcov.info
- name: Run fsdocs
run: dotnet fsdocs build --eval --strict --properties Configuration=Release
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GH_PAT }}
publish_dir: ./output
publish_branch: gh-pages
force_orphan: true
pack_cpu:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: dotnet restore
- name: Pack
run: dotnet pack --configuration Release --verbosity normal
- name: Publish NuGets
run: dotnet nuget push "bin/packages/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_KEY }} --skip-duplicate
# Done in a separate job because it downloads the massive Windows CUDA packages (though only for reference
# during the package build, it doesn't actually use them)
pack_cuda_windows:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Install dependencies
run: dotnet restore
- name: Pack (Furnace-cuda-windows)
run: dotnet pack --configuration Release --verbosity normal bundles/Furnace-cuda-windows
- name: Publish NuGets
run: dotnet nuget push "bin/packages/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_KEY }} --skip-duplicate
# Done in a separate job because it downloads the massive Linux CUDA packages (though only for reference
# during the package build, it doesn't actually use them)
pack_cuda_linux:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.102
- name: Disable global.json
run: mv ./global.json ./global.bak || true
- name: Install dependencies
run: dotnet restore
- name: Pack (Furnace-cuda-linux)
run: dotnet pack --configuration Release --verbosity normal bundles/Furnace-cuda-linux
- name: Publish NuGets
run: dotnet nuget push "bin/packages/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_KEY }} --skip-duplicate
# Done in a separate job because it downloads the massive Linux CUDA packages (though only for reference
# during the package build, it doesn't actually use them)
pack_cuda:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.102
- name: Disable global.json
run: mv ./global.json ./global.bak || true
- name: Install dependencies
run: dotnet restore
- name: Pack (Furnace-cuda)
run: dotnet pack --configuration Release --verbosity normal bundles/Furnace-cuda
- name: Publish NuGets
run: dotnet nuget push "bin/packages/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_KEY }} --skip-duplicate