From 838e9d838cc3c8817fefca29ece7413e13179dd1 Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Fri, 25 Oct 2024 12:56:11 -0500 Subject: [PATCH] Consolidate PR validation into one file with multiple jobs --- .github/workflows/build-and-test.yml | 24 --------- .github/workflows/build-multitool-for-npm.yml | 14 ------ .github/workflows/dotnet-format.yml | 24 --------- .github/workflows/validate-pr.yml | 50 +++++++++++++++++++ 4 files changed, 50 insertions(+), 62 deletions(-) delete mode 100644 .github/workflows/build-and-test.yml delete mode 100644 .github/workflows/build-multitool-for-npm.yml delete mode 100644 .github/workflows/dotnet-format.yml create mode 100644 .github/workflows/validate-pr.yml diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml deleted file mode 100644 index 04dcb2774..000000000 --- a/.github/workflows/build-and-test.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Build and Test - -on: - pull_request: - branches: [ "main" ] - -jobs: - build: - name: Run - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - with: - # GitHelper unit test requires full clone, not the shallow default of GitHub Actions - fetch-depth: 0 - - name: Setup dotnet - uses: actions/setup-dotnet@v4 - with: - dotnet-version: '3.1.x' - - name: Show dotnet info - run: dotnet --info - - name: Build and Test - # NoFormat because there is a separate format check action - run: ./BuildAndTest.cmd -NoFormat diff --git a/.github/workflows/build-multitool-for-npm.yml b/.github/workflows/build-multitool-for-npm.yml deleted file mode 100644 index 8347c3832..000000000 --- a/.github/workflows/build-multitool-for-npm.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Build Multitool for npm - -on: - pull_request: - branches: [ "main" ] - -jobs: - build: - name: Run - runs-on: windows-latest - steps: - - uses: actions/checkout@v4 - - name: Build Multitool for npm - run: ./scripts/BuildMultitoolForNpm.ps1 diff --git a/.github/workflows/dotnet-format.yml b/.github/workflows/dotnet-format.yml deleted file mode 100644 index c871bb2e0..000000000 --- a/.github/workflows/dotnet-format.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: dotnet format - -on: - pull_request: - branches: [ main ] - -jobs: - check-format: - runs-on: windows-latest - - steps: - - name: check out code - uses: actions/checkout@v2 - - - name: Setup .NET Core 3.1 - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.x - - - name: Install format tool - run: dotnet tool install -g dotnet-format - - - name: dotnet format - run: dotnet-format --folder --check --exclude .\src\Sarif\Autogenerated\ diff --git a/.github/workflows/validate-pr.yml b/.github/workflows/validate-pr.yml new file mode 100644 index 000000000..b709e76df --- /dev/null +++ b/.github/workflows/validate-pr.yml @@ -0,0 +1,50 @@ +name: Validate PR +on: + pull_request: + branches: [ "main" ] + +jobs: + ######################################################################### + build-and-test: + runs-on: windows-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + with: + # GitHelper unit test requires full clone, not the shallow default of GitHub Actions + fetch-depth: 0 + + - name: Setup dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '3.1.x' + + - name: Show dotnet info + run: dotnet --info + + - name: Build and Test + # NoFormat because there is a separate format check action below + run: ./BuildAndTest.cmd -NoFormat + + ######################################################################### + build-multitool-for-npm: + runs-on: windows-latest + steps: + - name: Checkout out code + uses: actions/checkout@v4 + + - name: Build Multitool for npm + run: ./scripts/BuildMultitoolForNpm.ps1 + + ######################################################################### + check-format: + runs-on: windows-latest + steps: + - name: Check out code + uses: actions/checkout@v2 + + - name: Install format tool + run: dotnet tool install -g dotnet-format + + - name: dotnet format + run: dotnet-format --folder --check --exclude .\src\Sarif\Autogenerated\