diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 257f434660..eb37904d8e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ env: jobs: changes: name: Check for changes - runs-on: ubuntu-latest # don't need matrix to test where the changes were made in code + runs-on: ubuntu-latest # don't need matrix to test where the changes were made in code permissions: pull-requests: read contents: read @@ -38,10 +38,44 @@ jobs: garnet: - '!((*.md)|(website/**))' + format-garnet: + name: Format Garnet + needs: changes + runs-on: ubuntu-latest + if: needs.changes.outputs.garnet == 'true' + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Install dependencies + run: dotnet restore Garnet.sln + - name: Check style format + run: dotnet format Garnet.sln --no-restore --verify-no-changes --verbosity diagnostic + + format-tsavorite: + name: Format Tsavorite + needs: changes + runs-on: ubuntu-latest + if: needs.changes.outputs.tsavorite == 'true' + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Install dependencies + run: dotnet restore libs/storage/Tsavorite/cs/Tsavorite.sln + - name: Check style format + run: dotnet format libs/storage/Tsavorite/cs/Tsavorite.sln --no-restore --verify-no-changes --verbosity diagnostic + # Job to build and test Garnet code build-test-garnet: name: Garnet - needs: changes + needs: [changes, format-garnet] runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -60,8 +94,6 @@ jobs: dotnet-version: 8.0.x - name: Install dependencies run: dotnet restore - - name: Check style format - run: dotnet format --verify-no-changes --verbosity diagnostic - name: Build Garnet run: dotnet build --configuration ${{ matrix.configuration }} - name: Run tests ${{ matrix.test }} @@ -77,7 +109,7 @@ jobs: # Job to build and test Tsavorite code (only if there were changes to it) build-test-tsavorite: name: Tsavorite - needs: changes + needs: [changes, format-tsavorite] runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -110,8 +142,6 @@ jobs: azurite & - name: Install dependencies run: dotnet restore - - name: Format - run: dotnet format --verify-no-changes --verbosity diagnostic - name: Build Tsavorite run: dotnet build libs/storage/Tsavorite/cs/test/Tsavorite.test.csproj --configuration ${{ matrix.configuration }} - name: Run Tsavorite tests @@ -151,4 +181,3 @@ jobs: steps: - run: echo Done! if: ${{ !(failure() || cancelled()) }} -