Skip to content

Git version and ci/cd #1

Git version and ci/cd

Git version and ci/cd #1

name: NewType CI
on:
push:
tags:
- 'v*'
branches:
- main
permissions:
checks: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '9.x'
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '6.0.0'
- name: Determine Version
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
- name: Run GitVersion
run: dotnet gitversion /output buildserver
- name: Set version
run: |
echo "# ${{ env.majorMinorPatch }}" >> $GITHUB_STEP_SUMMARY
- name: Restore dependencies
run: dotnet restore src/
- name: Build
run: dotnet build src/ -c Release --no-restore
- name: Test
run: |
dotnet test src/ \
--verbosity normal --no-build --no-restore \
--configuration Release \
--logger "trx;LogFileName=TestResults.trx"
- name: Publish test results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
files: '**/*.trx'
action_fail: true