-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (38 loc) · 1.08 KB
/
pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Validate PR
on:
pull_request:
branches:
- main
paths:
- 'src/**'
- 'tests/**'
- '*.sln'
- 'Dockerfile'
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Shallow clones should be disabled for a better relevancy of analysis
fetch-depth: 0
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8'
- name: Check if the project is well formatted
run: |
./scripts/start-check-formatting.sh
- name: Install dotnet-sonarscanner
run: |
dotnet tool install --global dotnet-sonarscanner
- name: Build the project, run all tests, and publish the test results
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
PR_SOURCE_BRANCH: ${{ github.head_ref }}
PR_TARGET_BRANCH: ${{ github.base_ref }}
GITHUB_PR_NUMBER: ${{github.event.pull_request.number}}
run: |
set -e
docker compose up -d db
./scripts/start-sonarcloud.sh