fixup: cachePath and use client everywhere #299
Workflow file for this run
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
name: CI | |
on: [push, pull_request] | |
jobs: | |
build_and_test: | |
name: Build & Test | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Setup .NET Core SDK 3.1.x | |
uses: actions/setup-dotnet@v1.7.2 | |
with: | |
dotnet-version: '3.1.x' | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Test | |
run: dotnet test --no-restore --verbosity normal | |
sanity_check: | |
name: Sanity Check | |
needs: build_and_test | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
# needed because of commit-lint, see https://github.com/conventional-changelog/commitlint/issues/3376 | |
fetch-depth: 0 | |
- name: Setup .NET SDK 5.0.x | |
uses: actions/setup-dotnet@v1.7.2 | |
with: | |
dotnet-version: '5.0.x' | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
# see https://github.com/dotnet/sdk/issues/15254 | |
- name: Prepare for installation of dotnet tools | |
run: dotnet new tool-manifest | |
- name: fsharpLint | |
run: | | |
dotnet tool install dotnet-fsharplint --version 0.21.3 | |
dotnet dotnet-fsharplint lint NOnion.sln | |
# FIXME: use `continue-on-error: true` when we figure out how to have a | |
# visual warning icon (instead of green tick) on GitHubActionsCI | |
- name: fantomless | |
run: | | |
dotnet tool install fantomless-tool --version 4.7.997-prerelease | |
dotnet fantomless --recurse . | |
git diff --exit-code | |
- name: Install dependencies of commitlint | |
run: | | |
sudo apt update | |
sudo apt install --yes git npm | |
- name: Pull our commitlint configuration | |
run: | | |
git clone https://github.com/nblockchain/conventions.git | |
rm -rf ./conventions/.git/ | |
- name: Validate current commit (last commit) with commitlint | |
if: github.event_name == 'push' | |
run: ./conventions/commitlint.sh --from HEAD~1 --to HEAD --verbose | |
- name: Validate PR commits with commitlint | |
if: github.event_name == 'pull_request' | |
run: ./conventions/commitlint.sh --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose | |
package: | |
name: Package (Nuget) | |
needs: sanity_check | |
runs-on: ubuntu-20.04 | |
env: | |
BASE_VERSION: "0.12.0" | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Setup .NET Core SDK 3.1.x | |
uses: actions/setup-dotnet@v1.7.2 | |
with: | |
dotnet-version: '3.1.x' | |
- name: Install dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --configuration Release --no-restore | |
- name: Package | |
# https://stackoverflow.com/questions/70249519/how-to-check-if-a-secret-variable-is-empty-in-if-conditional-github-actions | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
if: "${{ env.NUGET_API_KEY != '' }}" | |
run: | | |
git clone -b stable https://github.com/nblockchain/fsx | |
cd fsx | |
sudo ./scripts/CI/install_mono_from_microsoft_deb_packages.sh | |
cd ../NOnion | |
../fsx/Tools/nugetPush.fsx $BASE_VERSION ${{secrets.NUGET_API_KEY}} | |