Skip to content

Commit

Permalink
Add github pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Phoenox committed Dec 15, 2023
1 parent 0ffebf5 commit b581ca6
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
insert_final_newline = true
indent_style = space

[{*.cs,*.razor}]
indent_style = tab
47 changes: 47 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: .NET

on:
push:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'

- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore

- name: Setup sonarcloud analysis
run: |
dotnet tool install --global dotnet-sonarscanner
dotnet sonarscanner begin \
/k:"Phoenox_sidequest" /o:"phoenox" \
/d:sonar.token="${{ secrets.SONAR_TOKEN }}" \
/d:sonar.host.url="https://sonarcloud.io" \
/d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
- name: Build
run: dotnet build --no-restore

- name: Test with code coverage
run: |
dotnet tool install --global dotnet-coverage
dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml"
- name: Publish sonarcloud report
run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

0 comments on commit b581ca6

Please sign in to comment.