Skip to content

Commit

Permalink
feature(vnext): update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
wekempf committed Oct 1, 2023
1 parent f6e7496 commit 23c9809
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 86 deletions.
44 changes: 29 additions & 15 deletions .build_helper.ps1
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
function Verbose($Message) {
function Test-BuildServer {
if ($env:GITHUB_ACTIONS) {
Write-Output "::debug::$Message"
return 'github'
}
else {
Write-Verbose $Message

return $null
}

function Verbose($Message) {
switch (Test-BuildServer) {
'github' {
Write-Output "::debug::$Message"
}
default {
Write-Verbose $Message
}
}
}

Expand All @@ -16,19 +26,23 @@ function Info($Message) {
}

function Warning($Message) {
if ($env:GITHUB_ACTIONS) {
Write-Output "::warning::$Message"
}
else {
Write-Build Yellow $Message
switch (Test-BuildServer) {
'github' {
Write-Output "::warning::$Message"
}
default {
Write-Build Yellow $Message
}
}
}

function Error($Message) {
if ($env:GITHUB_ACTIONS) {
Write-Output "::error::$Message"
}
else {
Write-Build Red $Message
function Err($Message) {
switch (Test-BuildServer) {
'github' {
Write-Output "::error::$Message"
}
default {
Write-Build Red $Message
}
}
}
19 changes: 19 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@ name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- name: List files in the src directory
run: |
ls ${{ github.workspace }}/src
- name: List files in the tests directory
run: |
ls ${{ github.workspace }}/src/Tests
- name: List files in the Testify.Assertions.Tests directory
run: |
ls ${{ github.workspace }}/src/Tests/Testify.Assertions.Tests
- name: Build
shell: pwsh
run: ./build.ps1 -Task Test -Verbose
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions Testify.sln
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5F33DA26-515
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testify.Assertions", "src\Testify.Assertions\Testify.Assertions.csproj", "{5D45EAD5-5694-44A9-9BC5-E8D4EC223C72}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{38F9FCA7-EB52-400C-B9B9-8376AAB80C0F}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{38F9FCA7-EB52-400C-B9B9-8376AAB80C0F}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testify.Assertions.Tests", "src\tests\Testify.Assertions.Tests\Testify.Assertions.Tests.csproj", "{AC504586-CB6A-4355-84D4-D18BD2B76838}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Testify.Assertions.Tests", "src\Tests\Testify.Assertions.Tests\Testify.Assertions.Tests.csproj", "{AC504586-CB6A-4355-84D4-D18BD2B76838}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Testify.xUnit.Traits", "src\Testify.xUnit.Traits\Testify.xUnit.Traits.csproj", "{E08C2037-1FF1-486D-BA93-956605D7007A}"
EndProject
Expand Down
10 changes: 7 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,20 @@ Set-BuildFooter {
Section DarkYellow "Done $Path, $($Task.Elapsed)"
}

task update {
exec -Echo { dotnet restore Testify.sln --no-cache --force --verbosity quiet }
}

task restore {
dotnet restore Testify.sln --no-cache --force --verbosity quiet
exec -Echo { dotnet restore Testify.sln --locked-mode --no-cache --force --verbosity quiet }
}

task build restore, {
dotnet build Testify.sln -c Release --no-restore --nologo
exec -Echo { dotnet build Testify.sln -c Release --no-restore --nologo }
}

task test build, {
dotnet test Testify.sln -c Release --no-build --no-restore --nologo
exec -Echo { dotnet test Testify.sln -c Release --no-build --no-restore --nologo }
}

# Synopsis: Default build task.
Expand Down
2 changes: 1 addition & 1 deletion src/Testify.Moq/Testify.Moq.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net45</TargetFrameworks>
<TargetFrameworks>net7.0</TargetFrameworks>
<AssemblyName>Testify.Moq</AssemblyName>
<RootNamespace>Testify</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
42 changes: 0 additions & 42 deletions src/Testify.Moq/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,48 +1,6 @@
{
"version": 2,
"dependencies": {
".NETFramework,Version=v4.5": {
"Microsoft.NETFramework.ReferenceAssemblies": {
"type": "Direct",
"requested": "[1.0.3, )",
"resolved": "1.0.3",
"contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==",
"dependencies": {
"Microsoft.NETFramework.ReferenceAssemblies.net45": "1.0.3"
}
},
"Moq": {
"type": "Direct",
"requested": "[4.7.99, )",
"resolved": "4.7.99",
"contentHash": "nABMpxtxUb14VoPd0p0maxqjjbpHV/1MpvFiq1Kwb9NhHFC7V/1E40XYSOB2GeQ8tfz0/RyMn8SlDcmw0MB71w==",
"dependencies": {
"Castle.Core": "4.1.1"
}
},
"Castle.Core": {
"type": "Transitive",
"resolved": "4.1.1",
"contentHash": "O+88tWlRvtYLTn4dgAENyOgaLcExeox73ledI92d72z4U9IGSiiO8n/gnTnWgEMpBuXIdcyzrXHdGtn0c5Dz/A=="
},
"Microsoft.NETFramework.ReferenceAssemblies.net45": {
"type": "Transitive",
"resolved": "1.0.3",
"contentHash": "dcSLNuUX2rfZejsyta2EWZ1W5U6ucbFt697lRg1qiTlTM5ZlYv4uAvuxE6ROy6xLWWhLhOaReCDxkhxcajRYtQ=="
},
"testify": {
"type": "Project",
"dependencies": {
"System.ValueTuple": "[4.5.0, )"
}
},
"System.ValueTuple": {
"type": "CentralTransitive",
"requested": "[4.5.0, )",
"resolved": "4.5.0",
"contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ=="
}
},
"net7.0": {
"Moq": {
"type": "Direct",
Expand Down
2 changes: 1 addition & 1 deletion src/Testify/Testify.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net7.0;net45</TargetFrameworks>
<TargetFrameworks>net7.0</TargetFrameworks>
<AssemblyName>Testify</AssemblyName>
<RootNamespace>Testify</RootNamespace>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
Expand Down
22 changes: 0 additions & 22 deletions src/Testify/packages.lock.json
Original file line number Diff line number Diff line change
@@ -1,28 +1,6 @@
{
"version": 2,
"dependencies": {
".NETFramework,Version=v4.5": {
"Microsoft.NETFramework.ReferenceAssemblies": {
"type": "Direct",
"requested": "[1.0.3, )",
"resolved": "1.0.3",
"contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==",
"dependencies": {
"Microsoft.NETFramework.ReferenceAssemblies.net45": "1.0.3"
}
},
"System.ValueTuple": {
"type": "Direct",
"requested": "[4.5.0, )",
"resolved": "4.5.0",
"contentHash": "okurQJO6NRE/apDIP23ajJ0hpiNmJ+f0BwOlB/cSqTLQlw5upkf+5+96+iG2Jw40G1fCVCyPz/FhIABUjMR+RQ=="
},
"Microsoft.NETFramework.ReferenceAssemblies.net45": {
"type": "Transitive",
"resolved": "1.0.3",
"contentHash": "dcSLNuUX2rfZejsyta2EWZ1W5U6ucbFt697lRg1qiTlTM5ZlYv4uAvuxE6ROy6xLWWhLhOaReCDxkhxcajRYtQ=="
}
},
"net7.0": {
"System.ValueTuple": {
"type": "Direct",
Expand Down

0 comments on commit 23c9809

Please sign in to comment.