From 6a700c2f42f3957c4254bf56280f93280ae48fd1 Mon Sep 17 00:00:00 2001 From: Markus Rudy Date: Mon, 4 Nov 2024 21:20:48 +0100 Subject: [PATCH] ci: check for unclean patches --- .github/workflows/static.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 6b5dfc3c2..39080ebb6 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -68,3 +68,34 @@ jobs: - name: Run golangci-lint run: | nix run .#scripts.golangci-lint + + clean-patches: + runs-on: ubuntu-22.04 + timeout-minutes: 15 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + path: contrast + - uses: ./contrast/.github/actions/setup_nix + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} + cachixToken: ${{ secrets.CACHIX_AUTH_TOKEN }} + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + repository: kata-containers/kata-containers + - name: Check out Kata + run: | + git clone --depth 1 -b "$(nix eval --raw .#kata.kata-runtime.version)" https://github.com/kata-containers/kata-containers.git kata + - name: Apply patches + working-directory: kata + run: | + git config --global user.email "actionsbot@example.invalid" + git config --global user.name "Actions Bot" + git am --no-3way ../contrast/packages/by-name/kata/kata-runtime/*.patch + git format-patch -N --no-signature --zero-commit -o ../contrast/packages/by-name/kata/kata-runtime/ "$(nix eval --raw .#kata.kata-runtime.version)" + + git clone --depth 1 -b "$(nix eval --raw .#kata.kata-runtime.version)" https://github.com/kata-containers/kata-containers.git kata + - name: Check for diff + working-directory: contrast + run: | + git diff --exit-code