Skip to content

chore: migrate build to GitHub Actions #5

chore: migrate build to GitHub Actions

chore: migrate build to GitHub Actions #5

Workflow file for this run

name: "build and test"
on:
push:
branches: ["main"]
paths:
- 'src/**'
pull_request:
branches: ["main"]
paths:
- 'src/**'
- '.github/workflows/build.yml'
permissions:
actions: write
jobs:
analyze:
name: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: '5.x'
preferLatestVersion: true
- name: Determine version
uses: gittools/actions/gitversion/execute@v0
with:
updateAssemblyInfo: true
useConfigFile: true
configFilePath: gitversion.yml
- name: Display GitVersion variables (without prefix)
run: |
echo "Major: ${{ env.major }}"
echo "Minor: ${{ env.minor }}"
echo "Patch: ${{ env.patch }}"
echo "PreReleaseTag: ${{ env.preReleaseTag }}"
echo "PreReleaseTagWithDash: ${{ env.preReleaseTagWithDash }}"
echo "PreReleaseLabel: ${{ env.preReleaseLabel }}"
echo "PreReleaseNumber: ${{ env.preReleaseNumber }}"
echo "WeightedPreReleaseNumber: ${{ env.weightedPreReleaseNumber }}"
echo "BuildMetaData: ${{ env.buildMetaData }}"
echo "BuildMetaDataPadded: ${{ env.buildMetaDataPadded }}"
echo "FullBuildMetaData: ${{ env.fullBuildMetaData }}"
echo "MajorMinorPatch: ${{ env.majorMinorPatch }}"
echo "SemVer: ${{ env.semVer }}"
echo "LegacySemVer: ${{ env.legacySemVer }}"
echo "LegacySemVerPadded: ${{ env.legacySemVerPadded }}"
echo "AssemblySemVer: ${{ env.assemblySemVer }}"
echo "AssemblySemFileVer: ${{ env.assemblySemFileVer }}"
echo "FullSemVer: ${{ env.fullSemVer }}"
echo "InformationalVersion: ${{ env.informationalVersion }}"
echo "BranchName: ${{ env.branchName }}"
echo "EscapedBranchName: ${{ env.escapedBranchName }}"
echo "Sha: ${{ env.sha }}"
echo "ShortSha: ${{ env.shortSha }}"
echo "NuGetVersionV2: ${{ env.nuGetVersionV2 }}"
echo "NuGetVersion: ${{ env.nuGetVersion }}"
echo "NuGetPreReleaseTagV2: ${{ env.nuGetPreReleaseTagV2 }}"
echo "NuGetPreReleaseTag: ${{ env.nuGetPreReleaseTag }}"
echo "VersionSourceSha: ${{ env.versionSourceSha }}"
echo "CommitsSinceVersionSource: ${{ env.commitsSinceVersionSource }}"
echo "CommitsSinceVersionSourcePadded: ${{ env.commitsSinceVersionSourcePadded }}"
echo "UncommittedChanges: ${{ env.uncommittedChanges }}"
echo "CommitDate: ${{ env.commitDate }}"
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.x'
- name: Build solution
run: dotnet build >
--configuration Release
/p:Version=${{env.nuGetVersion}}
/p:ContinuousIntegrationBuild=true
/warnaserror
- name: Test library
run: dotnet test >
tests/indicators/Tests.Indicators.csproj
--configuration Release
--no-restore
--no-build
--collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura