Merge pull request #40 from Thorium/dev #81
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: 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 |