-
Notifications
You must be signed in to change notification settings - Fork 9
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 #163 from siemens/defect/Pool_changes
changes pool from self-hosted to github based runners
- Loading branch information
Showing
2 changed files
with
62 additions
and
44 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 |
---|---|---|
|
@@ -4,11 +4,10 @@ on: | |
push: | ||
pull_request: | ||
|
||
|
||
jobs: | ||
|
||
build: | ||
runs-on: self-hosted | ||
runs-on: windows-latest | ||
|
||
defaults: | ||
run: | ||
|
@@ -17,7 +16,6 @@ jobs: | |
semver: ${{ steps.gitversion.outputs.semver }} | ||
LicenseClearingTool: ${{ steps.packageBuildResults.outputs.LicenseClearingTool }} | ||
nupkg-LicenseClearingTool: ${{ steps.createNupkg.outputs.nupkg-LicenseClearingTool }} | ||
docker-LicenseClearingTool: ${{ steps.builddocker.outputs.docker-LicenseClearingTool }} | ||
|
||
steps: | ||
- name: Checkout | ||
|
@@ -40,7 +38,7 @@ jobs: | |
ACTIONS_ALLOW_UNSECURE_COMMANDS: TRUE | ||
|
||
- name: get SemVer | ||
if: ${{ false }} # disable for now | ||
#if: ${{ false }} # disable for now | ||
id: gitversion | ||
run: | | ||
echo "SemVer: v$($env:GitVersion_SemVer)" | ||
|
@@ -51,19 +49,6 @@ jobs: | |
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
|
||
|
||
- name: update appSettingsSW360IntegrationTest.json | ||
run: ./Scripts/json_update.ps1 -JsonFile 'src\TestUtilities\appSettingsSW360IntegrationTest.json' | ||
env: | ||
SW360HOST: ${{ secrets.SW360HOST }} | ||
SW360APPPORT: ${{ secrets.SW360APPPORT }} | ||
FOSSYHOST: ${{ secrets.FOSSYHOST }} | ||
FOSSYAPPPORT: ${{ secrets.FOSSYAPPPORT }} | ||
USEREMAIL: ${{ secrets.USEREMAIL }} | ||
ARTIFACTORYAPIKEY: ${{ secrets.ARTIFACTORYAPIKEY }} | ||
JFROGURL: ${{ secrets.JFROGURL }} | ||
SW360AUTHKEY: ${{ secrets.SW360AUTHTOKEN }} | ||
|
||
- name: update appsettingsUnitTest.json | ||
run: ./Scripts/json_update_ut.ps1 -JsonFile 'src\UnitTestUtilities\appsettingsUnitTest.json' | ||
|
@@ -78,16 +63,32 @@ jobs: | |
run: dotnet restore src\LicenseClearingTool.sln | ||
|
||
- name: Build | ||
run: msbuild -m -t:Rebuild -p:Configuration=Release -bl:continous-clearing.binlog -noconlog src\LicenseClearingTool.sln | ||
run: | | ||
dotnet build src\LicenseClearingTool.sln | ||
Write-Host "Files in directory:" | ||
dir $env:GITHUB_WORKSPACE\out\net6.0 | ||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: buildoutput | ||
path: ${{ github.workspace }}/out/net6.0 | ||
|
||
- name: Archive Build Log | ||
uses: actions/upload-artifact@v2 | ||
if: ${{ success() || failure() }} | ||
with: | ||
name: Compile_Solution_log | ||
path: | | ||
src/*.binlog | ||
*.binlog | ||
$env:GITHUB_WORKSPACE/src/*.binlog | ||
$env:GITHUB_WORKSPACE/*.binlog | ||
- name: Archive Build Output | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: continuous-clearing | ||
path: | | ||
out/continuous-clearing | ||
- name: Create zip | ||
id: packageBuildResults | ||
|
@@ -102,23 +103,11 @@ jobs: | |
Write-Host "::set-output name=LicenseClearingTool::$($fileName)" | ||
$outPath = Join-Path $outFolder $fileName | ||
Compress-Archive -DestinationPath $outPath -Path $sourceFolder -CompressionLevel Optimal | ||
- name: SW360 Instance refresh | ||
#if: ${{ false }} # disable for now | ||
run: | | ||
docker exec -dt sw360confctnr1 service postgresql stop | ||
docker stop sw360confctnr1 | ||
docker rm sw360confctnr1 | ||
docker run --name sw360confctnr1 --memory=7g -t -d -p ${env:SW360APPPORT}:8080 -p 5990:5984 -p 5440:5432 ${env:DOCKERDEVARTIFACTORY}/energy-dev/software-clearing/sw360/sw360conf:latest | ||
Start-Sleep -s 200 | ||
env: | ||
SW360APPPORT: ${{ secrets.SW360APPPORT }} | ||
DOCKERDEVARTIFACTORY: ${{ secrets.DOCKERDEVARTIFACTORY }} | ||
- name: Test | ||
#if: ${{ false }} # disable for now | ||
run: | | ||
$TestProjects = Get-ChildItem -Path *test*.csproj -Recurse -exclude TestUtilities.csproj,UnitTestUtilities.csproj | ||
$TestProjects = Get-ChildItem -Path *test*.csproj -Recurse -exclude TestUtilities.csproj,UnitTestUtilities.csproj,SW360IntegrationTest.csproj | ||
Write-Host "**************************The test projects considered for execution: $TestProjects ******************************" | ||
Write-Host "********************************************************************************************************************" | ||
foreach ($Project in $TestProjects) | ||
|
@@ -129,6 +118,7 @@ jobs: | |
dotnet test --no-build --configuration Release | ||
} | ||
- name: Archive Build Output | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
|
@@ -149,28 +139,56 @@ jobs: | |
path: | | ||
*.nupkg | ||
build-docker: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
|
||
outputs: | ||
docker-LicenseClearingTool: ${{ steps.builddocker.outputs.docker-LicenseClearingTool }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download Build Output | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: buildoutput | ||
path: ${{ github.workspace }}/buildoutput | ||
|
||
|
||
- name: Build the Docker image | ||
id: builddocker | ||
#if: ${{ false }} # disable for now | ||
run: | | ||
echo "Files in directory:" | ||
docker build . --file Dockerfile --tag ${{ github.repository }}:continuous-clearing-v6.2.0 | ||
docker save ${{ github.repository }}:continuous-clearing-v6.2.0 -o continuous-clearing-v6.2.0.tar | ||
Write-Host "::set-output name=docker-LicenseClearingTool::continuous-clearing-v6.2.0.tar" | ||
echo "::set-output name=docker-LicenseClearingTool::continuous-clearing-v6.2.0.tar" | ||
- name: Archive docker image | ||
#if: ${{ false }} # disable for now | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: docker-continuous-clearing | ||
path: | | ||
*.tar | ||
|
||
release: | ||
if: github.ref == 'refs/heads/main' | ||
runs-on: self-hosted | ||
needs: build | ||
#if: github.ref == 'refs/heads/main' | ||
runs-on: windows-latest | ||
needs: [build, build-docker] | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download Build Output | ||
uses: actions/download-artifact@v2 | ||
with: | ||
|
@@ -223,14 +241,14 @@ jobs: | |
asset_name: ${{ needs.build.outputs.nupkg-LicenseClearingTool }} | ||
asset_content_type: application/zip | ||
|
||
- name: Upload Nupkg | ||
- name: Upload Docker | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./${{ needs.build.outputs.docker-LicenseClearingTool }} | ||
asset_name: ${{ needs.build.outputs.docker-LicenseClearingTool }} | ||
asset_path: ./${{ needs.build-docker.outputs.docker-LicenseClearingTool }} | ||
asset_name: ${{ needs.build-docker.outputs.docker-LicenseClearingTool }} | ||
asset_content_type: application/zip | ||
|
||
- name: Upload ReadmeOSS_nupkg file | ||
|
@@ -239,7 +257,7 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./ReadmeOSS_continuous-clearing_nupkg.html | ||
asset_path: ${{ github.workspace }}\ReadmeOSS_continuous-clearing_nupkg.html | ||
asset_name: ReadmeOSS_continuous-clearing_nupkg.html | ||
asset_content_type: text/html | ||
|
||
|
@@ -249,6 +267,6 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./ReadmeOSS_continuous-clearing_DockerImage.html | ||
asset_path: ${{ github.workspace }}\ReadmeOSS_continuous-clearing_DockerImage.html | ||
asset_name: ReadmeOSS_continuous-clearing_DockerImage.html | ||
asset_content_type: text/html |
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