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 3e53834
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 84 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/test/Testify.Assertions.Tests
- name: Build
shell: pwsh
run: ./build.ps1 -Task Test -Verbose
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
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 3e53834

Please sign in to comment.