-
Notifications
You must be signed in to change notification settings - Fork 4
162 lines (143 loc) · 5.51 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
# 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: Test with coverage
run: |
mkdir -p coverage
dotnet test /p:CollectCoverage=true /p:CoverletOutput="$(pwd)/coverage/" /p:CoverletOutputFormat=opencover --configuration Release --no-build --verbosity normal
- name: Install ReportGenerator
run: dotnet tool install -g dotnet-reportgenerator-globaltool --version 5.1.26
- name: Convert coverage format
run: |
reportgenerator "-reports:coverage/coverage.opencover.xml" "-targetdir:coverage" "-reporttypes:lcov"
echo "LCOV file contents:"
cat coverage/lcov.info
echo "LCOV file size:"
ls -l coverage/lcov.info
- name: Upload coverage report to Coveralls
uses: coverallsapp/github-action@v2
with:
file: coverage/lcov.info
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }}
flag-name: unit-tests
format: lcov
base-path: /home/runner/work/Furnace/Furnace
fail-on-error: true # Change to true to see actual error
git-branch: ${{ github.ref }}
git-commit: ${{ github.sha }}
- name: Run fsdocs
run: dotnet fsdocs build --eval --strict --properties Configuration=Release
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
deploy_key: ${{ secrets.FURNACE_GITHUB_IO_DEPLOY_DOCS_PRIVATE_KEY }}
external_repository: fsprojects/furnace.github.io
publish_dir: ./docs
publish_branch: main
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