Skip to content

Merge branch 'dev' of https://github.com/fsprojects/Furnace into dev #9

Merge branch 'dev' of https://github.com/fsprojects/Furnace into dev

Merge branch 'dev' of https://github.com/fsprojects/Furnace into dev #9

# 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 5.0 (needed for Coveralls)
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.x
- 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: dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover --configuration Release --no-build --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: Run coveralls
run: >
dotnet csmacnz.Coveralls
--opencover -i tests/DiffSharp.Tests/coverage.opencover.xml
--useRelativePaths
--repoToken ${{ secrets.COVERALLS_REPO_TOKEN }}
--commitId ${{ github.sha }}
--commitBranch ${{ github.ref }}
--commitAuthor "${{ env.GIT_COMMIT_AUTHOR }}"
--commitEmail ${{ env.GIT_COMMIT_AUTHOR_EMAIL }}
--commitMessage "${{ env.GIT_COMMIT_MESSAGE }}"
--jobId ${{ github.run_number }}
# 16 Apr 2021: disabling codecov due to bash uploader security concern
# - name: Codecov
# uses: codecov/codecov-action@v1
- 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.DIFFSHARP_GITHUB_IO_DEPLOY_DOCS_PRIVATE_KEY }}
external_repository: DiffSharp/diffsharp.github.io
publish_dir: ./output
publish_branch: master
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_ORG_TOKEN_2022 }} --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 (DiffSharp-cuda-windows)
run: dotnet pack --configuration Release --verbosity normal bundles/DiffSharp-cuda-windows
- name: Publish NuGets
run: dotnet nuget push "bin/packages/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_ORG_TOKEN_2022 }} --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 (DiffSharp-cuda-linux)
run: dotnet pack --configuration Release --verbosity normal bundles/DiffSharp-cuda-linux
- name: Publish NuGets
run: dotnet nuget push "bin/packages/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_ORG_TOKEN_2022 }} --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 (DiffSharp-cuda)
run: dotnet pack --configuration Release --verbosity normal bundles/DiffSharp-cuda
- name: Publish NuGets
run: dotnet nuget push "bin/packages/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_ORG_TOKEN_2022 }} --skip-duplicate