-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (58 loc) · 1.86 KB
/
Copy pathci.yml
File metadata and controls
71 lines (58 loc) · 1.86 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
SOLUTION_PATH: 'TournamentAPI.sln'
jobs:
update-lock-files:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v6
with:
ref: ${{ github.head_ref }} # Required
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
- name: Regenerate lock files
run: dotnet restore ${{ env.SOLUTION_PATH }}
- name: Git
run: |
git diff --quiet "**/packages.lock.json" && echo "Nothing to commit" && exit 0
git config user.name "github-actions[bot]"
git config user.email "<>"
git add "**/packages.lock.json"
git commit -m "chore: regenerate packages.lock.json"
git push
build-test:
needs: update-lock-files
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 9.0.x
cache: true
cache-dependency-path: "**/packages.lock.json"
- name: Restore
run: dotnet restore ${{ env.SOLUTION_PATH }} --locked-mode
- name: Build
run: dotnet build ${{ env.SOLUTION_PATH }} --configuration Release --no-restore
- name: Test (Unit)
run: dotnet test TournamentAPI.UnitTests/TournamentAPI.UnitTests.csproj --configuration Release --no-restore --no-build
- name: Test (Integration)
env:
HealthCheck__ApiKey: ${{ secrets.HEALTHCHECK_API_KEY }}
run: dotnet test TournamentAPI.IntegrationTests/TournamentAPI.IntegrationTests.csproj --configuration Release --no-restore --no-build