From ec3e4e8801cc7b81560b33c96a9182be4dce1ad4 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Wed, 20 Mar 2024 14:08:14 +0000 Subject: [PATCH 1/4] Revert "ci: gate coverage analysis on whether source code changed" This reverts commit 32f9b1a231b895e9b5148d487a1606ad72f09ff3. --- .github/workflows/coveralls.yml | 13 ------------- contrib/classify-pr.sh | 4 ---- 2 files changed, 17 deletions(-) diff --git a/.github/workflows/coveralls.yml b/.github/workflows/coveralls.yml index 25d98c28..a3d37cd3 100644 --- a/.github/workflows/coveralls.yml +++ b/.github/workflows/coveralls.yml @@ -5,20 +5,7 @@ on: name: Code coverage with llvm-cov jobs: - Prepare: - runs-on: ubuntu-latest - outputs: - pr_changed_source: ${{ steps.classify_pr.outputs.pr_changed_source }} - steps: - - name: Checkout Crate - uses: actions/checkout@v4 - - name: Determine what files the PR changes. - id: classify_pr - run: contrib/classify-pr.sh ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.base.sha }} - Coveralls: - needs: Prepare - if: needs.Prepare.outputs.pr_changed_source == 'true' name: Code coverage - stable toolchain runs-on: ubuntu-latest strategy: diff --git a/contrib/classify-pr.sh b/contrib/classify-pr.sh index e72fba5d..0cab8cce 100755 --- a/contrib/classify-pr.sh +++ b/contrib/classify-pr.sh @@ -16,10 +16,6 @@ git fetch origin "$pr_tip":pr_tip pr_base=$(git merge-base master_tip pr_tip) -echo "Using master $master_tip" -echo "Using PR tip $pr_tip" -echo "Using PR base $pr_base" - # If something modifies any non-markdown file, it's considered a source code change. if git diff --name-only "$pr_base" "$pr_tip" | grep -qv "^.md$"; then echo "pr_changed_source=true" >> "$GITHUB_OUTPUT" From 495d7e8acd27adf8277e554067536d2021a69995 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Wed, 20 Mar 2024 14:08:15 +0000 Subject: [PATCH 2/4] Revert "ci: gate fuzztesting on whether source code changed" This reverts commit 2203c02347607a03cbddc78f601a62f30f4d509c. --- .github/workflows/fuzz.yml | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/.github/workflows/fuzz.yml b/.github/workflows/fuzz.yml index 232d8812..3a0e4d1a 100644 --- a/.github/workflows/fuzz.yml +++ b/.github/workflows/fuzz.yml @@ -9,20 +9,8 @@ on: pull_request: jobs: - Prepare: - runs-on: ubuntu-latest - outputs: - pr_changed_source: ${{ steps.classify_pr.outputs.pr_changed_source }} - steps: - - name: Checkout Crate - uses: actions/checkout@v4 - - name: Determine what files the PR changes. - id: classify_pr - run: contrib/classify-pr.sh ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.base.sha }} - fuzz: - needs: Prepare - if: ${{ !github.event.act }} && needs.Prepare.outputs.pr_changed_source == 'true' + if: ${{ !github.event.act }} runs-on: ubuntu-latest strategy: fail-fast: false @@ -76,8 +64,7 @@ jobs: path: executed_${{ matrix.fuzz_target }} verify-execution: - needs: Prepare - if: ${{ !github.event.act }} && needs.Prepare.outputs.pr_changed_source == 'true' + if: ${{ !github.event.act }} needs: fuzz runs-on: ubuntu-latest steps: From ae381fcc0191d4218766a82458892ff2faa793ed Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Wed, 20 Mar 2024 14:08:16 +0000 Subject: [PATCH 3/4] Revert "ci: gate CI workflow on source being changed" This reverts commit 09f7fc3cffada71124d9bdd38c8eb5b54db3783d. --- .github/workflows/rust.yml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6081d431..4a5174d3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -30,7 +30,6 @@ jobs: Stable: needs: Prepare - if: needs.Prepare.outputs.pr_changed_source == 'true' name: Test - stable toolchain runs-on: ubuntu-latest strategy: @@ -52,7 +51,6 @@ jobs: Beta: needs: Prepare - if: needs.Prepare.outputs.pr_changed_source == 'true' name: Test - beta toolchain runs-on: ubuntu-latest strategy: @@ -73,7 +71,6 @@ jobs: Nightly: needs: Prepare - if: needs.Prepare.outputs.pr_changed_source == 'true' name: Test - nightly toolchain runs-on: ubuntu-latest strategy: @@ -98,7 +95,6 @@ jobs: MSRV: needs: Prepare - if: needs.Prepare.outputs.pr_changed_source == 'true' name: Test - 1.56.1 toolchain runs-on: ubuntu-latest strategy: @@ -120,8 +116,6 @@ jobs: run: ./contrib/run_task.sh ${{ matrix.crate }} ${{ matrix.task }} Arch32bit: - needs: Prepare - if: needs.Prepare.outputs.pr_changed_source == 'true' name: Test 32-bit version runs-on: ubuntu-latest steps: @@ -139,9 +133,8 @@ jobs: run: cargo test --target i686-unknown-linux-gnu Cross: - needs: Prepare - if: ${{ !github.event.act }} && needs.Prepare.outputs.pr_changed_source == 'true' name: Cross test + if: ${{ !github.event.act }} runs-on: ubuntu-latest steps: - name: Checkout Crate @@ -157,7 +150,6 @@ jobs: Embedded: needs: Prepare - if: needs.Prepare.outputs.pr_changed_source == 'true' runs-on: ubuntu-latest env: RUSTFLAGS: "-C link-arg=-Tlink.x" @@ -183,7 +175,6 @@ jobs: ASAN: needs: Prepare - if: needs.Prepare.outputs.pr_changed_source == 'true' name: Address sanitizer # hashes crate only. runs-on: ubuntu-latest strategy: @@ -206,7 +197,6 @@ jobs: WASM: needs: Prepare - if: needs.Prepare.outputs.pr_changed_source == 'true' name: WebAssembly Build # hashes crate only. runs-on: ubuntu-latest strategy: @@ -225,7 +215,6 @@ jobs: Schemars: needs: Prepare - if: needs.Prepare.outputs.pr_changed_source == 'true' name: Schemars runs-on: ubuntu-latest strategy: @@ -243,8 +232,6 @@ jobs: run: ./contrib/run_task.sh ${{ matrix.crate }} ${{ matrix.task }} Kani: - needs: Prepare - if: needs.Prepare.outputs.pr_changed_source == 'true' runs-on: ubuntu-20.04 steps: - name: 'Checkout your code.' From 50e772fe7921f3b73858f857aa049839a118122c Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Wed, 20 Mar 2024 14:08:17 +0000 Subject: [PATCH 4/4] Revert "ci: introduce `classify-pr.sh` script which determines whether a PR should have CI run" This reverts commit 9aca8a18c7fdd8c1e873429553e401805f794013. --- .github/workflows/rust.yml | 4 ---- contrib/classify-pr.sh | 25 ------------------------- 2 files changed, 29 deletions(-) delete mode 100755 contrib/classify-pr.sh diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4a5174d3..169e2e5f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,13 +14,9 @@ jobs: crates: ${{ steps.get_matrix.outputs.crates }} deps: ${{ steps.get_matrix.outputs.deps }} nightly_version: ${{ steps.read_toolchain.outputs.nightly_version }} - pr_changed_source: ${{ steps.classify_pr.outputs.pr_changed_source }} steps: - name: Checkout Crate uses: actions/checkout@v4 - - name: Determine what files the PR changes. - id: classify_pr - run: contrib/classify-pr.sh ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.base.sha }} - name: Read nightly version id: read_toolchain run: echo "nightly_version=$(cat .github/nightly-version)" >> $GITHUB_OUTPUT diff --git a/contrib/classify-pr.sh b/contrib/classify-pr.sh deleted file mode 100755 index 0cab8cce..00000000 --- a/contrib/classify-pr.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -if [ "$#" -ne 2 ]; then - echo "Usage: $0 " - exit 1 -fi - -pr_tip=$1 -master_tip=$2 - -# When called on `pull_request`, GA fails to pull down master by default. -# When called on `push`, GA fails to pull down the PR by default, only its merge commit. -# The simplest way to deal with this is to just pull both explicitly. -git fetch origin "$master_tip":master_tip -git fetch origin "$pr_tip":pr_tip - -pr_base=$(git merge-base master_tip pr_tip) - -# If something modifies any non-markdown file, it's considered a source code change. -if git diff --name-only "$pr_base" "$pr_tip" | grep -qv "^.md$"; then - echo "pr_changed_source=true" >> "$GITHUB_OUTPUT" -else - echo "pr_changed_source=false" >> "$GITHUB_OUTPUT" -fi -