Skip to content

Commit a33ee58

Browse files
Import of code from old repo
1 parent 903b551 commit a33ee58

36 files changed

Lines changed: 4513 additions & 0 deletions
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Your GitHub workflow file under .github/workflows/
2+
# Trigger the action on push to main
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9+
permissions:
10+
actions: read
11+
pages: write
12+
id-token: write
13+
14+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
15+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
publish-docs:
22+
environment:
23+
name: github-pages
24+
url: ${{ steps.deployment.outputs.page_url }}
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v3
29+
- name: Dotnet Setup
30+
uses: actions/setup-dotnet@v3
31+
with:
32+
dotnet-version: 9.x
33+
34+
- run: dotnet tool update -g docfx
35+
- run: docfx docs/docfx.json
36+
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v3
39+
with:
40+
# Upload entire repository
41+
path: 'docs/_site'
42+
- name: Deploy to GitHub Pages
43+
id: deployment
44+
uses: actions/deploy-pages@v4

.github/workflows/dotnet.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: .NET
5+
6+
on:
7+
push:
8+
branches: [ "main" ]
9+
pull_request:
10+
branches: [ "main" ]
11+
12+
jobs:
13+
build:
14+
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
dotnet-version: [ '9.0.x' ]
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: ${{ matrix.dotnet-version }}
26+
27+
- name: Install dependencies
28+
run: dotnet restore
29+
30+
- name: Test with dotnet
31+
run: dotnet test --no-restore --logger trx --results-directory "TestResults-${{ matrix.dotnet-version }}"
32+
33+
- name: Upload dotnet test results
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: dotnet-results-${{ matrix.dotnet-version }}
37+
path: TestResults-${{ matrix.dotnet-version }}
38+
39+
# Use always() to always run this step to publish test results when there are test failures
40+
if: ${{ always() }}

.github/workflows/sonarqube.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: SonarQube
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
types: [opened, synchronize, reopened]
8+
jobs:
9+
build:
10+
name: Build and analyze
11+
runs-on: windows-latest
12+
steps:
13+
- name: Set up JDK 17
14+
uses: actions/setup-java@v4
15+
with:
16+
java-version: 17
17+
distribution: 'zulu' # Alternative distribution options are available.
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
21+
- name: Cache SonarQube Cloud packages
22+
uses: actions/cache@v4
23+
with:
24+
path: ~\sonar\cache
25+
key: ${{ runner.os }}-sonar
26+
restore-keys: ${{ runner.os }}-sonar
27+
- name: Cache SonarQube Cloud scanner
28+
id: cache-sonar-scanner
29+
uses: actions/cache@v4
30+
with:
31+
path: .\.sonar\scanner
32+
key: ${{ runner.os }}-sonar-scanner
33+
restore-keys: ${{ runner.os }}-sonar-scanner
34+
- name: Install SonarQube Cloud scanner
35+
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
36+
shell: powershell
37+
run: |
38+
New-Item -Path .\.sonar\scanner -ItemType Directory
39+
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
40+
- name: Build and analyze
41+
env:
42+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
43+
shell: powershell
44+
run: |
45+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"rent-a-developer_AutoIndexCache" /o:"rent-a-developer" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.scanner.scanAll=false /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
46+
dotnet tool install --global dotnet-coverage
47+
dotnet build --no-incremental
48+
dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml"
49+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
obj
2+
bin
3+
.vs
4+
5+
**/AssemblyInfo.cs
6+
**/*.suo
7+
**/*.DotSettings.user
8+
**/*.csproj.user
9+
10+
**/launchSettings.json
11+
.sonarlint/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net9.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
12+
</ItemGroup>
13+
14+
<ItemGroup>
15+
<ProjectReference Include="..\AutoIndexCache.Tests\AutoIndexCache.Tests.csproj" />
16+
<ProjectReference Include="..\AutoIndexCache\AutoIndexCache.csproj" />
17+
</ItemGroup>
18+
19+
</Project>

0 commit comments

Comments
 (0)