From b0b4c3dffd9f84ea18236e8f9055d642de029a1d Mon Sep 17 00:00:00 2001 From: Stefan Holderbach Date: Sat, 23 Dec 2023 20:28:07 +0100 Subject: [PATCH] Check for clean repo after tests (#11409) Goal: detect problems like adressed by #11407 or missing `Cargo.lock` update early Try to fail when there is a non clear `git status` message --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ scripts/test_virtualenv.nu | 1 + 2 files changed, 34 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d98fb6cc0..dc91e928e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,6 +92,17 @@ jobs: - name: Tests run: cargo test --workspace --profile ci --exclude nu_plugin_* ${{ matrix.flags }} + - name: Check for clean repo + shell: bash + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "there are changes"; + git status --porcelain + exit 1 + else + echo "no changes in working directory"; + fi + std-lib-and-python-virtualenv: strategy: fail-fast: true @@ -129,6 +140,17 @@ jobs: run: nu scripts/test_virtualenv.nu shell: bash + - name: Check for clean repo + shell: bash + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "there are changes"; + git status --porcelain + exit 1 + else + echo "no changes in working directory"; + fi + plugins: strategy: fail-fast: true @@ -150,3 +172,14 @@ jobs: - name: Tests run: cargo test --profile ci --package nu_plugin_* + + - name: Check for clean repo + shell: bash + run: | + if [ -n "$(git status --porcelain)" ]; then + echo "there are changes"; + git status --porcelain + exit 1 + else + echo "no changes in working directory"; + fi diff --git a/scripts/test_virtualenv.nu b/scripts/test_virtualenv.nu index e6628ea53..dec6a8fbd 100644 --- a/scripts/test_virtualenv.nu +++ b/scripts/test_virtualenv.nu @@ -53,4 +53,5 @@ def main [] { let msg = $"OUTPUT:\n($o)\n\nEXPECTED:\n($e)" error make {msg: $"Output does not match the expected value:\n($msg)"} } + rm script.nu }