Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflows tweaks #69

Merged
merged 7 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
Expand All @@ -25,16 +25,21 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Build
run: dotnet build
run: dotnet build --no-incremental
- name: Test
run: dotnet test --no-build --verbosity normal

run: dotnet test --no-build --verbosity normal --logger trx --results-directory "TestResults"
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: dotnet-results
path: TestResults
if: ${{ always() }}
pack:
runs-on: ubuntu-latest
needs:
Expand All @@ -43,7 +48,7 @@ jobs:
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
types:
- opened
- synchronize
- reopened
- ready_for_review
schedule:
# Run every week, at a randomly picked time and day
- cron: '16 23 * * 4'

jobs:
analyze:
name: Analyze
# Avoid running for Draft pull requests
if: github.event.pull_request.draft == false
runs-on: 'ubuntu-latest'
timeout-minutes: 360
permissions:
security-events: write
actions: read
contents: read

strategy:
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: 'csharp'

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

- name: Build
run: dotnet build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:csharp"
20 changes: 20 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Check PR Labels

on:
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
- unlabeled

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Check for "do not merge" label
if: contains(github.event.pull_request.labels.*.name, 'do not merge')
run: |
echo "This PR should not be merged."
exit 1