Skip to content

Commit

Permalink
CI work
Browse files Browse the repository at this point in the history
  • Loading branch information
scottt732 committed Nov 3, 2023
1 parent 3eec303 commit 2d09484
Show file tree
Hide file tree
Showing 7 changed files with 125 additions and 133 deletions.
1 change: 0 additions & 1 deletion .actrc

This file was deleted.

5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@
"files.insertFinalNewline": true
},
"extensions": [
"ms-dotnettools.csdevkit",
"codezombiech.gitignore",
"michelemelluso.gitignore",
"eamodio.gitlens",
"GitHub.copilot",
"ms-dotnettools.csdevkit",
"github.vscode-github-actions",
"redhat.vscode-yaml",
"EditorConfig.EditorConfig",
"formulahendry.dotnet-test-explorer"
]
}
Expand Down
113 changes: 76 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,93 @@ name: Build
on:
push:
branches:
- '*'
tags:
- '*'
- main
pull_request:
release:
types:
- published
workflow_dispatch:

env:
# Disable the .NET logo in the console output.
DOTNET_NOLOGO: true
# Disable the .NET first time experience to skip caching NuGet packages and speed up the build.
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
# Disable sending .NET CLI telemetry to Microsoft.
DOTNET_CLI_TELEMETRY_OPTOUT: true
# Set the build number in MinVer.
MINVERBUILDMETADATA: build.${{github.run_number}}
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages

jobs:
build:
name: Build-${{matrix.os}}
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest] # , windows-latest, macOS-latest
os: [ubuntu-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
lfs: true
fetch-depth: 0
- name: 'Git Fetch Tags'
run: git fetch --tags
shell: pwsh
- name: 'Install .NET SDK'
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.101
- name: 'Dotnet Tool Restore'
run: dotnet tool restore
shell: pwsh
- name: 'Dotnet Cake Build'
run: dotnet cake --target=Build
shell: pwsh
- name: 'Dotnet Cake Test'
run: dotnet cake --target=Test
shell: pwsh
- name: 'Dotnet Cake Pack'
run: dotnet cake --target=Pack
shell: pwsh
- name: 'Publish Artifacts'
uses: actions/upload-artifact@v2
with:
name: ${{matrix.os}}
path: './Artifacts/*'
- uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
lfs: true
- name: 'Git Fetch Tags'
run: git fetch --tags
- name: Enable nuget package locking
run: touch packages.lock.json
- name: 'Install .NET SDK'
uses: actions/setup-dotnet@v3
with:
global-json-file: global.json
cache: true
- name: 'Dotnet Tool Restore'
run: dotnet tool restore
- name: "Dotnet Cake Build"
run: dotnet cake --target=Build
- name: "Dotnet Cake Test"
run: dotnet cake --target=Test
- name: "Dotnet Cake Pack"
run: dotnet cake --target=Pack
- name: 'Publish Artifacts'
uses: actions/upload-artifact@v3
with:
name: ${{matrix.os}}
path: './Artifacts/*'

publish-test-results:
name: "Publish Tests Results"
needs: build
if: always()
permissions:
checks: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: "Download Artifact"
uses: actions/download-artifact@v3.0.2
with:
path: "./Artifacts"
- name: "Publish Test Summary"
uses: test-summary/action@v2
if: always()
with:
paths: "./Artifacts/*/*.xml"

push-github-packages:
name: "Push GitHub Packages"
needs: build
if: github.ref == 'refs/heads/main' || github.event_name == 'release'
env:
name: "GitHub Packages"
url: "https://github.com/${{github.repository}}/packages"
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- name: "Download Artifact"
uses: actions/download-artifact@v3.0.2
with:
name: "ubuntu-latest"
- name: "Dotnet NuGet Add Source"
run: dotnet nuget add source https://nuget.pkg.github.com/GITHUB-USERNAME/index.json --name GitHub --username GITHUB-USERNAME --password ${{secrets.GITHUB_TOKEN}}
shell: pwsh
- name: "Dotnet NuGet Push"
run: dotnet nuget push .\*.nupkg --api-key '${{ github.token }}' --source GitHub --skip-duplicate
shell: pwsh
46 changes: 42 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

# User-specific files
*.rsuser
Expand Down Expand Up @@ -57,7 +57,7 @@ dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/

# .NET
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
Expand Down Expand Up @@ -90,6 +90,7 @@ StyleCopReport.xml
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
Expand Down Expand Up @@ -142,7 +143,9 @@ _TeamCity*
!.axoCover/settings.json

# Coverlet is a free, cross platform Code Coverage Tool
coverage*[.json, .xml, .info]
coverage*.json
coverage*.xml
coverage*.info

# Visual Studio code coverage results
*.coverage
Expand Down Expand Up @@ -291,6 +294,17 @@ node_modules/
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw

# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp

# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp

# Visual Studio 6 technical files
*.ncb
*.aps

# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
Expand Down Expand Up @@ -347,6 +361,9 @@ ASALocalRun/
# Local History for Visual Studio
.localhistory/

# Visual Studio History (VSHistory) files
.vshistory/

# BeatPulse healthcheck temp database
healthchecksdb

Expand All @@ -357,4 +374,25 @@ MigrationBackup/
.ionide/

# Fody - auto-generated XML schema
FodyWeavers.xsd
FodyWeavers.xsd

# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp

# JetBrains Rider
*.sln.iml
3 changes: 2 additions & 1 deletion Tests/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
</PropertyGroup>

<ItemGroup Label="Package References">
<PackageReference Update="coverlet.collector" Version="6.0.0">
<PackageReference Include="coverlet.collector" Version="6.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="JunitXml.TestLogger" Version="3.0.134" />
<PackageReference Include="Moq" Version="4.20.69" />
<PackageReference Include="xunit" Version="2.5.1" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" Version="2.5.1">
Expand Down
89 changes: 0 additions & 89 deletions azure-pipelines.yml

This file was deleted.

1 change: 1 addition & 0 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Task("Test")
{
$"trx;LogFileName={project.GetFilenameWithoutExtension()}.trx",
$"html;LogFileName={project.GetFilenameWithoutExtension()}.html",
$"junit;LogFileName={project.GetFilenameWithoutExtension()}.xml",
},
NoBuild = true,
NoRestore = true,
Expand Down

0 comments on commit 2d09484

Please sign in to comment.