simplify coverage path #33
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
run: | | |
mkdir -p coverage | |
dotnet test /p:CollectCoverage=true /p:CoverletOutput=../coverage/ /p:CoverletOutputFormat=opencover --configuration Release --no-build --verbosity normal | |
- name: Generate coverage report | |
run: | | |
dotnet tool install -g dotnet-reportgenerator-globaltool --version 4.8.12 | |
reportgenerator -reports:coverage.opencover.xml -targetdir:coverage -reporttypes:Html | |
env: | |
LD_LIBRARY_PATH: /usr/lib/x86_64-linux-gnu | |
- 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: Generate coverage report | |
run: | | |
dotnet tool install -g dotnet-reportgenerator-globaltool --version 4.8.12 | |
reportgenerator -reports:./coverage/coverage.opencover.xml -targetdir:coverage -reporttypes:Html | |
env: | |
LD_LIBRARY_PATH: /usr/lib/x86_64-linux-gnu | |
- name: Upload coverage report to Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
file: coverage/coverage.opencover.xml | |
github-token: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
- 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 |