From f17290d0f1042152c2c34b6e434c113cdb56e554 Mon Sep 17 00:00:00 2001 From: Patrick Stevens <3138005+Smaug123@users.noreply.github.com> Date: Thu, 30 May 2024 12:10:49 +0100 Subject: [PATCH] Check generation of files is accurate (#145) --- .github/workflows/dotnet.yaml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yaml b/.github/workflows/dotnet.yaml index 23d1019..e975e16 100644 --- a/.github/workflows/dotnet.yaml +++ b/.github/workflows/dotnet.yaml @@ -1,3 +1,4 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/github-workflow.json name: .NET on: @@ -86,6 +87,27 @@ jobs: - name: Run Fantomas run: nix run .#fantomas -- --check . + check-accurate-generations: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # so that NerdBank.GitVersioning has access to history + - name: Install Nix + uses: cachix/install-nix-action@V27 + with: + extra_nix_config: | + access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} + - name: Whitespace change + run: "echo ' ' >> ConsumePlugin/List.fs" + - name: Generate code + run: nix develop --command dotnet build + - name: Run Fantomas + run: nix run .#fantomas -- . + - name: Verify there is no diff + run: git diff --name-only --no-color --exit-code + check-nix-format: runs-on: ubuntu-latest steps: @@ -175,7 +197,7 @@ jobs: run: if [[ $(find packed-attribute -maxdepth 1 -name 'WoofWare.Myriad.Plugins.Attributes.*.nupkg' -printf c | wc -c) -ne "1" ]]; then exit 1; fi all-required-checks-complete: - needs: [check-dotnet-format, check-nix-format, build, build-nix, linkcheck, flake-check, analyzers, nuget-pack, expected-pack] + needs: [check-dotnet-format, check-nix-format, check-accurate-generations, build, build-nix, linkcheck, flake-check, analyzers, nuget-pack, expected-pack] runs-on: ubuntu-latest steps: - run: echo "All required checks complete."