Skip to content

Commit

Permalink
Delete build and test actions, update workflow with new build and tes…
Browse files Browse the repository at this point in the history
…t steps.

- Removed old build and test actions
- Added new build and test steps in the workflow
  • Loading branch information
winromulus committed Jun 15, 2024
1 parent 1c0b29b commit 5d9c926
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 98 deletions.
57 changes: 0 additions & 57 deletions .github/actions/build/action.yaml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/actions/test/action.yaml

This file was deleted.

89 changes: 64 additions & 25 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,65 @@ jobs:
playground:
- 'playground/**'
- name: build
if: ${{ steps.change_detection.outputs.changes != '[]' }}
uses: ./.github/actions/build
- name: tools - dotnet - install
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.x'

- name: tools - gitversion - install
if: ${{ inputs.useVersioning == 'true' }}
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: '5.x'
preferLatestVersion: true

- name: tools - gitversion - execute
if: ${{ inputs.useVersioning == 'true' }}
uses: gittools/actions/gitversion/[email protected]
# with:
# useConfigFile: true
# configFilePath: GitVersion.yaml

- name: cache - nuget
uses: actions/cache@v4
with:
configuration: Debug
useVersioning: false
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: test
if: ${{ steps.change_detection.outputs.changes != '[]' }}
uses: ./.github/actions/test
- name: dotnet restore
shell: bash
run: dotnet restore

- name: dotnet build
if: ${{ inputs.useVersioning == 'true' }}
shell: bash
run: dotnet build --no-restore --configuration Release /p:Version=${{env.GitVersion_SemVer}} /p:AssemblyVersion=${{env.GitVersion_AssemblySemFileVer}} /p:NuGetVersion=${{env.GitVersion_SemVer}}

- name: dotnet test
shell: bash
run: dotnet test --no-build --configuration Release --verbosity normal

- name: test-reporter
uses: dorny/test-reporter@v1
if: always()
with:
name: Test Results
path: .artifacts/TestResults/*.trx
reporter: dotnet-trx

- name: artifacts - nuget - gather
run: |
mkdir -p .artifacts/nuget
find . -name "*.nupkg" -exec cp {} .artifacts/nuget/ \;
- name: artifacts - nuget - upload
uses: actions/upload-artifact@v4
with:
name: artifacts-nuget
path: .artifacts/nuget/*.nupkg

cd:
name: CD
Expand All @@ -61,27 +110,17 @@ jobs:
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.ref, 'refs/heads/hotfix/'))
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: build
uses: ./.github/actions/build
- name: artifacts - nuget - download
uses: actions/download-artifact@v4
with:
configuration: Release
useVersioning: true

- name: artifacts - nuget - gather
run: |
mkdir -p .artifacts/nuget
find . -name "*.nupkg" -exec cp {} .artifacts/nuget/ \;
name: artifacts-nuget
path: .artifacts/nuget

- name: artifacts - nuget - upload
uses: actions/upload-artifact@v4
- name: checkout
uses: actions/checkout@v4
with:
name: artifacts-nuget
path: .artifacts/nuget/*.nupkg
fetch-depth: 0

- name: git - tag
if: >
Expand Down

0 comments on commit 5d9c926

Please sign in to comment.