generated from BRP-API/brp-shared
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from BRP-API/chore/sync-met-source-repo_064d498
sync met 'BRP-API/brp-shared-dotnet' repo
- Loading branch information
Showing
7 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Genereer build run identifier | ||
description: Genereer een build run identifier op basis van datum en tijd (<jaar><maand><dag><uur><minuut>) | ||
|
||
outputs: | ||
build-run: | ||
description: een build run identifier gegenereerd op basis van datum en tijd | ||
value: ${{ steps.get-build-run.outputs.BUILD_RUN }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Get build run identifier | ||
id: get-build-run | ||
run: | | ||
export TZ="Europe/Amsterdam" | ||
echo "BUILD_RUN=$(date +'%Y%m%d%H%M')" >> $GITHUB_OUTPUT | ||
shell: bash |
20 changes: 20 additions & 0 deletions
20
.github/actions/haal-build-run-identifier-uit-docker-manifest/action.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Haal build run identifier uit Docker manifest | ||
description: Haal de build run identifier uit een docker manifest | ||
|
||
inputs: | ||
path-docker-manifest: | ||
description: het pad van een docker manifest | ||
required: true | ||
outputs: | ||
build-run: | ||
description: de build run identifier in de docker manifest | ||
value: ${{ steps.get-build-run.outputs.BUILD_RUN }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Get build run identifier | ||
id: get-build-run | ||
run: | | ||
echo "BUILD_RUN=$(sed -n 's/image:.*:.*-\(.*\)/\1/p' ${{ inputs.path-docker-manifest }})" >> $GITHUB_OUTPUT | ||
shell: bash |
20 changes: 20 additions & 0 deletions
20
.github/actions/haal-versie-uit-docker-manifest/action.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Haal versie uit Docker manifest | ||
description: Haal de versie uit een docker manifest | ||
|
||
inputs: | ||
path-docker-manifest: | ||
description: het pad van een docker manifest | ||
required: true | ||
outputs: | ||
version: | ||
description: de versie string in de docker manifest | ||
value: ${{ steps.get-version.outputs.VERSION }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Get version | ||
id: get-version | ||
run: | | ||
echo "APP_VERSION=$(sed -n 's/image:.*:\(.*\)-.*/\1/p' ${{ inputs.path-docker-manifest }})" >> $GITHUB_OUTPUT | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Toevoegen localhost naam | ||
description: Voeg een host naam toe voor localhost in het /etc/hosts bestand | ||
|
||
inputs: | ||
host-name: | ||
description: de naam dat moet worden toegevoegd voor localhost (127.0.0.1) | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Add a host name to /etc/hosts | ||
run: | | ||
sudo echo '127.0.0.1 ${{ inputs.host-name }}' | sudo tee -a /etc/hosts | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Valideer .NET solution | ||
description: Compileren van de projecten en uitvoeren van de unit tests opgenomen in een .NET solution bestand | ||
|
||
inputs: | ||
path-solution-file: | ||
description: het pad van een .NET solution file | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: | | ||
6.0.x | ||
8.0.x | ||
- name: Restore dependencies | ||
run: dotnet restore ${{ inputs.path-solution-file }} | ||
shell: bash | ||
- name: Build | ||
run: dotnet build ${{ inputs.path-solution-file }} --configuration Release --no-restore | ||
shell: bash | ||
- name: Run unit tests | ||
run: dotnet test ${{ inputs.path-solution-file }} --configuration Release --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./test-reports/coverage | ||
shell: bash |
13 changes: 13 additions & 0 deletions
13
.github/actions/zet-run-bash-scripts-permission/action.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Zet run bash script permission | ||
description: Zet run permission voor een bash script of voor alle bash scripts in een map | ||
|
||
inputs: | ||
path-bash-file-or-folder: | ||
description: pad van een bash script of pad van een bash script map. Voeg /* toe in geval van een script map | ||
required: true | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- run: sudo chmod +x ${{ inputs.path-bash-file-or-folder }} | ||
shell: bash |
31 changes: 31 additions & 0 deletions
31
.github/actions/zet-versie-met-build-run-in-csproj/action.yml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Zet versie met build run identifier in csproj file | ||
description: Voeg de build run conform semver in het Version element van de opgegeven csproj bestand | ||
|
||
# source: https://www.jameskerr.blog/posts/sharing-steps-in-github-action-workflows/ | ||
|
||
inputs: | ||
path-csproj-file: | ||
description: path van het csproj bestand | ||
required: true | ||
build-run: | ||
description: string dat als build wordt gebruikt conform semver | ||
required: true | ||
outputs: | ||
version: | ||
description: de versie string in het Version element | ||
value: ${{ steps.get-version.outputs.VERSION }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Get version element value | ||
id: get-version | ||
run: | | ||
echo "VERSION=$(sed -n 's/.*<Version>\([0-9.]*\).*/\1/p' ${{ inputs.path-csproj-file }})" >> $GITHUB_OUTPUT | ||
shell: bash | ||
- name: Append build run identifier | ||
run: | | ||
search_string="\(<Version>\([0-9.]*\)\)" | ||
replace_string="<Version>${{ steps.get-version.outputs.VERSION }}+${{ inputs.build-run }}" | ||
sed -i "s/$search_string/$replace_string/" ${{ inputs.path-csproj-file }} | ||
shell: bash |