Skip to content

Redundant test

Redundant test #175

Workflow file for this run

name: publish-nuget-package
on:
push:
branches:
- main
- feature/**
jobs:
calculate-version:
name: Calculate Version
runs-on: ubuntu-latest
env:
LBHPACKAGESTOKEN: ${{ secrets.LBHPACKAGESTOKEN }}
outputs:
version: ${{ steps.gitversion.outputs.nuGetVersionV2 }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
- name: Determine package version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
- name: Display package version
run: |
echo "Version: $GITVERSION_NUGETVERSIONV2"
check-code-formatting:
name: Check code formatting
runs-on: ubuntu-latest
needs: calculate-version
env:
LBHPACKAGESTOKEN: ${{ secrets.LBHPACKAGESTOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dotnet format
run: dotnet tool install dotnet-format --tool-path ./dotnet-format-local/
- name: Run formatter check
run: ./dotnet-format-local/dotnet-format --check
build-and-test:
name: Build & Test
runs-on: ubuntu-latest
needs: calculate-version
env:
LBHPACKAGESTOKEN: ${{secrets.LBHPACKAGESTOKEN }}
outputs:
version: ${{ needs.calculate-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: docker-compose build hackney-shared-housing-search-test
- name: Run tests
run: docker-compose run hackney-shared-housing-search-test
publish-package:
name: Publish Package
runs-on: ubuntu-latest
needs: build-and-test
env:
LBHPACKAGESTOKEN: ${{secrets.LBHPACKAGESTOKEN }}
VERSION: ${{ needs.build-and-test.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build the Package
run: dotnet pack Hackney.Shared.HousingSearch -p:PackageVersion=$VERSION --configuration Release
- name: Publish the Package
run: |
cd Hackney.Shared.HousingSearch/bin/Release
dotnet nuget push Hackney.Shared.HousingSearch.*.nupkg -s https://nuget.pkg.github.com/LBHackney-IT/index.json --api-key ${{secrets.NUGET_KEY }}