Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: .NET

on:
workflow_dispatch:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
name: Build and analyze
runs-on: windows-latest
permissions:
contents: read
env:
SONAR_PROJECT: 'astar-dev-utilities'
ProjectName: 'AStar.Dev.Utilities'
RepositoryName: 'astar-dev-utilities'
steps:
- name: Set up JDK
uses: actions/[email protected]
with:
java-version: 17
distribution: 'zulu'

- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0

- name: 🛠 Cache SonarQube Cloud packages
uses: actions/[email protected]
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar

- name: 🛠 Cache SonarQube Cloud scanner
id: cache-sonar-scanner
uses: actions/[email protected]
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner

- name: 🛠 Install SonarQube Cloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner

- name: 🔍 Restore, 🛠 Build and 🧪 Test with ☁️ SonarCloud / Qube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
dotnet tool install --global dotnet-coverage
.\.sonar\scanner\dotnet-sonarscanner begin /k:"astar-development_${{ env.SONAR_PROJECT }}" /o:"astar-development" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:sonar.scanner.scanAll=false /d:sonar.scanner.skipJreProvisioning=true
dotnet build --configuration Release
dotnet-coverage collect 'dotnet test --filter "FullyQualifiedName!~Tests.EndToEnd"' -f xml -o 'coverage.xml'
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
22 changes: 16 additions & 6 deletions .github/workflows/main_astar-dev.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,55 @@
name: SonarQube

permissions:
contents: read

on:
push:
branches:
- main
pull_request:
types: [ opened, synchronize, reopened ]

jobs:

build:
name: Build and analyze
runs-on: windows-latest

steps:
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu' # Alternative distribution options are available.
distribution: 'zulu'

- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache SonarQube Cloud packages
fetch-depth: 0

- name: 🛠 Cache SonarQube Cloud packages
uses: actions/cache@v4
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarQube Cloud scanner

- name: 🛠 Cache SonarQube Cloud scanner
id: cache-sonar-scanner
uses: actions/cache@v4
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarQube Cloud scanner

- name: ☁️ Install SonarQube Cloud scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- name: Build and analyze

- name: 🛠 Build, 🧪 Test and analyse with ☁️ SonarCloud / Qube
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: 🚀 Publish NuGet Package

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
env:
ProjectName: 'AStar.Dev.Utilities'

steps:
- name: 🧾 Checkout code
uses: actions/checkout@v4

- name: 🛠 Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'

- name: 🔍 Restore dependencies
run: dotnet restore

- name: 🛠 Build solution
run: dotnet build --configuration Release

- name: 📦 Pack NuGet package
run: dotnet pack ./src/${{ env.ProjectName }}/${{ env.ProjectName }}.csproj --configuration Release --output ./nupkg

- name: 🚀 Publish to NuGet.org
run: dotnet nuget push ./nupkg/*.nupkg --skip-duplicate --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NuGet_API_Key }} #

1 change: 1 addition & 0 deletions .idea/.idea.AStar.Dev.Database.Testing/.idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion .idea/.idea.DatabaseTesting/.idea/.name

This file was deleted.

Loading
Loading