From 18027afdd07a0511424a6c73d48d95a32cb1de69 Mon Sep 17 00:00:00 2001 From: Predrag Gruevski <2348618+obi1kenobi@users.noreply.github.com> Date: Sun, 9 Apr 2023 17:47:01 -0400 Subject: [PATCH] Fix the ref-slice job on Linux, make it actually check stuff on Windows (#425) * Fix the ref-slice job on Linux, see if it works on Windows. * Fix the action on Windows as well. --- .github/workflows/ci.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2c77d8ad..5e6c7d45 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1181,7 +1181,7 @@ jobs: uses: Swatinem/rust-cache@v2 with: workspaces: | - subject/target/semver-checks/local-ref_slice-1_2_2/ + subject/target/semver-checks/local-ref_slice-1_2_1/ - name: Run semver-checks continue-on-error: true @@ -1199,7 +1199,7 @@ jobs: - name: Baseline is correct run: | cd semver - EXPECTED="$(echo -e " Checking ref_slice v1.2.1 -> v1.2.2 (patch change)")" + EXPECTED="$(echo -e " Checking ref_slice v1.2.1 -> v1.2.1 (no change)")" # Strip ANSI escapes for colors and bold text before comparing. RESULT="$(cat output | grep ' -> v1.' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g")" diff <(echo "$RESULT") <(echo "$EXPECTED") @@ -1273,7 +1273,7 @@ jobs: uses: Swatinem/rust-cache@v2 with: workspaces: | - subject\target\semver-checks\local-ref_slice-1_2_2\ + subject\target\semver-checks\local-ref_slice-1_2_1\ - name: Run cargo-semver-checks continue-on-error: true @@ -1291,17 +1291,19 @@ jobs: - name: Baseline is correct run: | cd semver - $EXPECTED = " Checking ref_slice v1.2.1 -> v1.2.2 (patch change)" + $EXPECTED = " Checking ref_slice v1.2.1 -> v1.2.1 (no change)" # Strip ANSI escapes for colors and bold text before comparing. - $RESULT = (cat output | grep 'ref_slice v1.' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g") | Out-String - compare $RESULT $EXPECTED + cat output | grep ' -> v1.' | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | Out-File -FilePath check_line + cat check_line + grep "$EXPECTED" check_line - name: Semver break found run: | cd semver $EXPECTED = "--- failure function_missing: pub fn removed or renamed ---" - $RESULT = (cat output | grep failure) - compare $RESULT $EXPECTED + cat output | grep failure | Out-File -FilePath failure_line + cat failure_line + grep "$EXPECTED" failure_line # Ensure the following fragment (not full line!) is in the output file: grep ' function ref_slice::ref_slice, previously in file' output