-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (66 loc) · 2.2 KB
/
build-test.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
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
name: Build & Test
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
name: Build & Test Project
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: csharp
build-mode: manual
config-file: ./.github/codeql/codeql-config.yml
- name: Restore dependencies
run: |
dotnet restore src/FloppyBot.sln
- name: Build
run: dotnet build --no-restore src/FloppyBot.sln
- name: Test
run: dotnet test --no-restore --no-build src/FloppyBot.sln
env:
FLOPPYTEST_DiscordBot1__ClientId: ${{ secrets.DISCORD_1_CLIENT_ID }}
FLOPPYTEST_DiscordBot1__ClientSecret: ${{ secrets.DISCORD_1_CLIENT_SECRET }}
FLOPPYTEST_DiscordBot1__Token: ${{ secrets.DISCORD_1_TOKEN }}
FLOPPYTEST_DiscordBot2__ClientId: ${{ secrets.DISCORD_2_CLIENT_ID }}
FLOPPYTEST_DiscordBot2__ClientSecret: ${{ secrets.DISCORD_2_CLIENT_SECRET }}
FLOPPYTEST_DiscordBot2__Token: ${{ secrets.DISCORD_2_TOKEN }}
FLOPPYTEST_DiscordServerId: ${{ secrets.DISCORD_SERVER_ID }}
FLOPPYTEST_DiscordChannelId: ${{ secrets.DISCORD_CHANNEL_ID }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:csharp"
code-style:
name: Check Code Style
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: |
dotnet restore src/FloppyBot.sln
dotnet tool restore
- name: Check Code Format
run: |
dotnet csharpier --check src/
- name: Check Code Style
run: |
dotnet format style --verify-no-changes src/
- name: Run Format Analyzer
run: |
dotnet format analyzers --verify-no-changes src/