Skip to content

Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #10

Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows

Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #10

Workflow file for this run

name: IKVM.Logging
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build
runs-on: windows-2022
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: Setup .NET 3.1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup .NET 7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: 5.x
- name: Execute GitVersion
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
- name: Move NuGet Directory
shell: pwsh
run: Add-Content $env:GITHUB_ENV "`nNUGET_PACKAGES=${{ runner.temp }}\nuget\packages"
- name: Add NuGet Source (GitHub)
shell: pwsh
run: dotnet nuget add source --username USERNAME --password $env:GITHUB_TOKEN --store-password-in-clear-text --name ikvm $env:GITHUB_REPOS
env:
GITHUB_REPOS: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Cache NuGet
uses: actions/cache@v3
with:
path: ${{ runner.temp }}\nuget\packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**\*.csproj', '**\*.msbuildproj') }}-1
restore-keys: ${{ runner.os }}-nuget-
- name: NuGet Restore
run: dotnet restore IKVM.Logging.sln
- name: Build
run: |
dotnet msbuild /m /bl `
/p:Configuration="Release" `
/p:Platform="Any CPU" `
/p:Version=${env:GitVersion_FullSemVer} `
/p:AssemblyVersion=${env:GitVersion_AssemblySemVer} `
/p:InformationalVersion=${env:GitVersion_InformationalVersion} `
/p:FileVersion=${env:GitVersion_AssemblySemFileVer} `
/p:PackageVersion=${env:GitVersion_NuGetVersionV2} `
/p:RepositoryUrl="${env:GITHUB_SERVER_URL}/${env:GITHUB_REPOSITORY}.git" `
/p:PackageProjectUrl="${env:GITHUB_SERVER_URL}/${env:GITHUB_REPOSITORY}" `
/p:BuildInParallel=true `
/p:CreateHardLinksForAdditionalFilesIfPossible=true `
/p:CreateHardLinksForCopyAdditionalFilesIfPossible=true `
/p:CreateHardLinksForCopyFilesToOutputDirectoryIfPossible=true `
/p:CreateHardLinksForCopyLocalIfPossible=true `
/p:CreateHardLinksForPublishFilesIfPossible=true `
/p:ContinuousIntegrationBuild=true `
IKVM.Logging.dist.msbuildproj
- name: Upload MSBuild Log
if: ${{ always() }}
uses: actions/upload-artifact@v3
with:
name: msbuild.binlog
path: msbuild.binlog
- name: Upload NuGet Packages
uses: actions/upload-artifact@v3
with:
name: nuget
path: dist/nuget
- name: Package Tests
run: tar czvf tests.tar.gz tests
working-directory: dist
- name: Upload Tests
uses: actions/upload-artifact@v3
with:
name: tests
path: dist/tests.tar.gz
test:
strategy:
matrix:
run:
- IKVM.Extensions.Logging.Java.Util.Tests
sys:
- windows
- linux
- macos
tfm:
- net461
- netcoreapp3.1
- net6.0
- net7.0
exclude:
- tfm: net461
sys: linux
- tfm: net461
sys: macos
- tfm: netcoreapp3.1
sys: macos
name: Test (${{ matrix.run }}:${{ matrix.tfm }}:${{ matrix.sys }})
needs:
- build
runs-on: ${{ fromJSON('{"windows":["windows-2022"],"linux":["ubuntu-22.04"],"macos":["macos-latest"]}')[matrix.sys] }}
steps:
- name: Setup .NET 3.1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 3.1.x
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup .NET 7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Add NuGet Source (GitHub)
shell: pwsh
run: dotnet nuget add source --username USERNAME --password $env:GITHUB_TOKEN --store-password-in-clear-text --name ikvm $env:GITHUB_REPOS
env:
GITHUB_REPOS: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Download Tests
uses: actions/[email protected]
with:
name: tests
- name: Restore Tests
run: tar xzvf tests.tar.gz
- name: Execute Tests
timeout-minutes: 480
shell: pwsh
run: |
# assign powershell variables
$run = "${{ matrix.run }}"
$tfm = "${{ matrix.tfm }}"
$sys = "${{ matrix.sys }}"
# suite name can contain filter expression after ?
$split = $run.IndexOf("?")
if ($split -gt -1) {
$tst = $run.Substring(0, $split)
$qry = $run.Substring($split + 1)
} else {
$tst = $run
}
# scan for test assemblies
$tests = $(gci .\tests\$tst\$tfm -Recurse -Filter '*.Tests.dll')
# if a query was specified, add to test command
if ($tests) {
if ($qry -ne "" -and $qry -ne $null) {
Add-Content $env:GITHUB_ENV "`nRET=TestResults--$tst-$qry--$tfm--$sys"
dotnet test -f $tfm --blame -v 2 --results-directory "TestResults" --logger:"console;verbosity=detailed" --logger:trx --collect "Code Coverage" --filter "$qry" $tests
} else {
Add-Content $env:GITHUB_ENV "`nRET=TestResults--$tst--$tfm--$sys"
dotnet test -f $tfm --blame -v 2 --results-directory "TestResults" --logger:"console;verbosity=detailed" --logger:trx --collect "Code Coverage" $tests
}
}
- name: Archive Test Results
if: always() && startsWith(env.RET, 'TestResults--')
run: tar czvf TestResults.tar.gz TestResults
working-directory: ${{ env.IKVMPATH }}
- name: Upload Test Results
if: always() && startsWith(env.RET, 'TestResults--')
uses: actions/upload-artifact@v3
with:
name: ${{ env.RET }}
path: TestResults.tar.gz
release:
name: Release
needs:
- test
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup .NET 7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0
with:
versionSpec: 5.x
- name: Execute GitVersion
id: GitVersion
uses: gittools/actions/gitversion/execute@v0
with:
useConfigFile: true
- name: Download NuGet Packages
uses: actions/[email protected]
with:
name: nuget
path: dist/nuget
- name: Create Release
if: ${{ github.ref == 'refs/heads/main' }}
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.GitVersion.outputs.semVer }}
allowUpdates: true
artifacts: dist/nuget/*.nupkg,dist/nuget/*.snupkg
draft: false
makeLatest: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Push NuGet (GitHub)
shell: pwsh
run: dotnet nuget push dist/nuget/*.nupkg --source $env:GITHUB_REPOS --api-key $env:GITHUB_TOKEN --skip-duplicate --no-symbols
env:
GITHUB_REPOS: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push NuGet
if: ${{ github.ref == 'refs/heads/main' }}
shell: pwsh
run: dotnet nuget push dist/nuget/*.nupkg --source $env:NUGET_REPOS --api-key $env:NUGET_TOKEN --skip-duplicate
env:
NUGET_REPOS: https://api.nuget.org/v3/index.json
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}