From 3cccce24b714900fab8f0597c13263697f35b2d5 Mon Sep 17 00:00:00 2001 From: Maximilien Noal Date: Tue, 23 Jan 2024 21:18:52 +0100 Subject: [PATCH] Github workflows: codeql and unit tests run now on any PRs (#566) * Github workflows: codeql now also runs unit tests on PRs Signed-off-by: Maximilien Noal * dependabot: fixed, doesn't work on sln files Signed-off-by: Maximilien Noal --------- Signed-off-by: Maximilien Noal --- .github/dependabot.yml | 22 +++++++++++++-- .github/workflows/codeql.yml | 10 ++----- .github/workflows/{dotnet.yml => nuget.yml} | 2 +- .github/workflows/pr.yml | 27 +++++++++++++++++++ .../{autorelease.yml => prerelease.yml} | 0 5 files changed, 50 insertions(+), 11 deletions(-) rename .github/workflows/{dotnet.yml => nuget.yml} (98%) create mode 100644 .github/workflows/pr.yml rename .github/workflows/{autorelease.yml => prerelease.yml} (100%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2abb08082..cdaf409bf 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,8 +3,26 @@ version: 2 updates: - package-ecosystem: "nuget" - directory: "/src" + directory: "/src/Spice86" schedule: interval: "weekly" day: "wednesday" - open-pull-requests-limit: 8 + open-pull-requests-limit: 5 + - package-ecosystem: "nuget" + directory: "/src/Spice86.Core" + schedule: + interval: "weekly" + day: "wednesday" + open-pull-requests-limit: 5 + - package-ecosystem: "nuget" + directory: "/src/Spice86.Logging" + schedule: + interval: "weekly" + day: "wednesday" + open-pull-requests-limit: 5 + - package-ecosystem: "nuget" + directory: "/tests/Spice86.Tests" + schedule: + interval: "weekly" + day: "wednesday" + open-pull-requests-limit: 5 \ No newline at end of file diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ff6fd287f..f7ed1dd44 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -12,18 +12,12 @@ name: "CodeQL" on: - push: - branches: [ "master" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "master" ] - schedule: - - cron: '15 6 * * 4' + pull_request jobs: analyze: name: Analyze - runs-on: ${{ (matrix.language == 'csharp' && 'macos-latest') || 'ubuntu-latest' }} + runs-on: 'ubuntu-latest' permissions: actions: read contents: read diff --git a/.github/workflows/dotnet.yml b/.github/workflows/nuget.yml similarity index 98% rename from .github/workflows/dotnet.yml rename to .github/workflows/nuget.yml index 1ccfea1b4..0a3fe67ac 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/nuget.yml @@ -1,4 +1,4 @@ -name: .NET Build +name: Test and Publish NuGet # Trigger the workflow on push to master on: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 000000000..a6f84b947 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,27 @@ +name: Test and Publish NuGet + +# Trigger the workflow on PRs +on: + pull_request + +jobs: + build: + + strategy: + matrix: + os: [macos-latest, windows-latest, ubuntu-latest] + fail-fast: false + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v1 + + - name: Setup .NET + uses: actions/setup-dotnet@v1 + with: + dotnet-version: '8.0.x' + + - name: Test with dotnet + working-directory: ./src + run: dotnet test --configuration Release diff --git a/.github/workflows/autorelease.yml b/.github/workflows/prerelease.yml similarity index 100% rename from .github/workflows/autorelease.yml rename to .github/workflows/prerelease.yml