Skip to content

Commit 2840b02

Browse files
authored
Workflows tweaks (#69)
1 parent c572030 commit 2840b02

3 files changed

Lines changed: 83 additions & 6 deletions

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
- name: Setup .NET
1919
uses: actions/setup-dotnet@v3
2020
with:
@@ -25,16 +25,21 @@ jobs:
2525
build:
2626
runs-on: ubuntu-latest
2727
steps:
28-
- uses: actions/checkout@v3
28+
- uses: actions/checkout@v4
2929
- name: Setup .NET
3030
uses: actions/setup-dotnet@v3
3131
with:
3232
dotnet-version: 8.0.x
3333
- name: Build
34-
run: dotnet build
34+
run: dotnet build --no-incremental
3535
- name: Test
36-
run: dotnet test --no-build --verbosity normal
37-
36+
run: dotnet test --no-build --verbosity normal --logger trx --results-directory "TestResults"
37+
- name: Upload test results
38+
uses: actions/upload-artifact@v3
39+
with:
40+
name: dotnet-results
41+
path: TestResults
42+
if: ${{ always() }}
3843
pack:
3944
runs-on: ubuntu-latest
4045
needs:
@@ -43,7 +48,7 @@ jobs:
4348
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
4449
steps:
4550
- name: Checkout
46-
uses: actions/checkout@v3
51+
uses: actions/checkout@v4
4752
- name: Setup .NET
4853
uses: actions/setup-dotnet@v3
4954
with:

.github/workflows/codeql.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
types:
9+
- opened
10+
- synchronize
11+
- reopened
12+
- ready_for_review
13+
schedule:
14+
# Run every week, at a randomly picked time and day
15+
- cron: '16 23 * * 4'
16+
17+
jobs:
18+
analyze:
19+
name: Analyze
20+
# Avoid running for Draft pull requests
21+
if: github.event.pull_request.draft == false
22+
runs-on: 'ubuntu-latest'
23+
timeout-minutes: 360
24+
permissions:
25+
security-events: write
26+
actions: read
27+
contents: read
28+
29+
strategy:
30+
fail-fast: false
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@v4
35+
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@v3
38+
with:
39+
languages: 'csharp'
40+
41+
- name: Setup .NET
42+
uses: actions/setup-dotnet@v3
43+
with:
44+
dotnet-version: 8.0.x
45+
46+
- name: Build
47+
run: dotnet build
48+
49+
- name: Perform CodeQL Analysis
50+
uses: github/codeql-action/analyze@v3
51+
with:
52+
category: "/language:csharp"

.github/workflows/labels.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Check PR Labels
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
- labeled
10+
- unlabeled
11+
12+
jobs:
13+
check:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check for "do not merge" label
17+
if: contains(github.event.pull_request.labels.*.name, 'do not merge')
18+
run: |
19+
echo "This PR should not be merged."
20+
exit 1

0 commit comments

Comments
 (0)