From 074cb1fc8cd29364509d858fb8d9796d7b28a7ec Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 6 Aug 2025 08:55:35 -0400 Subject: [PATCH 1/9] run actionlint in ci --- .github/actionlint.yml | 26 +++++++++++++++++ .github/workflows/build-wheels.yml | 45 ++++++++++++++++++++---------- 2 files changed, 57 insertions(+), 14 deletions(-) create mode 100644 .github/actionlint.yml diff --git a/.github/actionlint.yml b/.github/actionlint.yml new file mode 100644 index 000000000..7a735464a --- /dev/null +++ b/.github/actionlint.yml @@ -0,0 +1,26 @@ +self-hosted-runner: + # Labels of self-hosted runner in array of strings. + labels: ["benchmark", "glue-notify"] + +# Configuration variables in array of strings defined in your repository or +# organization. `null` means disabling configuration variables check. +# Empty array means no configuration variable is allowed. +config-variables: null + +# Configuration for file paths. The keys are glob patterns to match to file +# paths relative to the repository root. The values are the configurations for +# the file paths. Note that the path separator is always '/'. +# The following configurations are available. +# +# "ignore" is an array of regular expression patterns. Matched error messages +# are ignored. This is similar to the "-ignore" command line option. +paths: + # .github/workflows/**/*.yml: + # ignore: [] + # ".github/workflows/*.y*ml": + # ignore: ["string should not be empty", ".* SC2002:.*"] + # ".github/workflows/test-single.yml": + # ignore: [ + # # special case here using a variable as a key in the excludes + # 'value .*\$\{\{ inputs.matrix_mode \}\}.* in "exclude" does not match in matrix "python" combinations. possible values are', + # ] diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index 0f7829516..cac715d15 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -153,14 +153,14 @@ jobs: python -m pip install --upgrade pip python -m pip install maturin - - name: Build MacOs with maturin on Python ${{ matrix.python }} + - name: Build MacOs with maturin on Python ${{ matrix.python.major-dot-minor }} if: matrix.os.matrix == 'macos' env: MACOSX_DEPLOYMENT_TARGET: "13.0" run: | maturin build -i python --release -m wheel/Cargo.toml --features=openssl,pyo3/extension-module - - name: Build Linux with maturin on Python ${{ matrix.python }} + - name: Build Linux with maturin on Python ${{ matrix.python.major-dot-minor }} if: matrix.os.matrix == 'ubuntu' run: | docker run --rm --pull always \ @@ -178,7 +178,7 @@ jobs: CC=gcc maturin build --release --manylinux ${{ matrix.python.by-arch[matrix.arch.matrix].manylinux-version }} -m wheel/Cargo.toml --features=openssl,pyo3/extension-module \ ' - - name: Build Windows with maturin on Python ${{ matrix.python }} + - name: Build Windows with maturin on Python ${{ matrix.python.major-dot-minor }} if: matrix.os.matrix == 'windows' env: CC: "clang" @@ -264,14 +264,14 @@ jobs: pip install maturin maturin sdist -m wheel/Cargo.toml cd target/wheels - dirname=`basename chia_rs*.tar.gz .tar.gz` - echo $dirname - mkdir $dirname - cp -r ../../src/ $dirname/src/ - gunzip chia_rs*.tar.gz - tar rvf chia_rs*.tar $dirname/src - gzip chia_rs*.tar - rm -rf $dirname + dirname=$(basename "chia_rs*.tar.gz" .tar.gz) + echo "$dirname" + mkdir "$dirname" + cp -r ../../src/ "$dirname/src/" + gunzip "chia_rs*.tar.gz" + tar rvf "chia_rs*.tar" "$dirname/src" + gzip "chia_rs*.tar" + rm -rf "$dirname" - name: Upload artifacts uses: actions/upload-artifact@v4 @@ -310,6 +310,21 @@ jobs: run: | cargo clippy --workspace --all-features --all-targets + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: actionlint + run: | + bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash) + echo ==== shellcheck version + shellcheck --version + echo ==== actionlint version + ./actionlint --version + echo ==== running actionlint + ./actionlint -color -shellcheck shellcheck + unit_tests: runs-on: ${{ matrix.os }} strategy: @@ -332,9 +347,11 @@ jobs: if: matrix.os == 'ubuntu-latest' run: | cargo install grcov --locked - echo "RUSTFLAGS=-Cinstrument-coverage" >> "$GITHUB_ENV" - echo "LLVM_PROFILE_FILE=$(pwd)/target/chia_rs-%p-%m.profraw" >> "$GITHUB_ENV" - echo "CARGO_TARGET_DIR=$(pwd)/target" >> "$GITHUB_ENV" + { + echo "RUSTFLAGS=-Cinstrument-coverage" + echo "LLVM_PROFILE_FILE=$(pwd)/target/chia_rs-%p-%m.profraw" + echo "CARGO_TARGET_DIR=$(pwd)/target" + } >> "$GITHUB_ENV" - name: cargo test (not windows) if: matrix.os != 'windows-latest' run: cargo test --workspace --all-features From e50bbdee99d1916925a781cde760ad9ad08527ff Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 6 Aug 2025 14:12:43 -0400 Subject: [PATCH 2/9] fix --- .github/workflows/build-wheels.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index e7b4174bb..b4ecad0ba 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -264,13 +264,13 @@ jobs: pip install maturin maturin sdist -m wheel/Cargo.toml cd target/wheels - dirname=$(basename "chia_rs*.tar.gz" .tar.gz) + dirname=$(basename chia_rs*.tar.gz .tar.gz) echo "$dirname" mkdir "$dirname" cp -r ../../src/ "$dirname/src/" - gunzip "chia_rs*.tar.gz" - tar rvf "chia_rs*.tar" "$dirname/src" - gzip "chia_rs*.tar" + gunzip chia_rs*.tar.gz + tar rvf chia_rs*.tar "$dirname/src" + gzip chia_rs*.tar rm -rf "$dirname" - name: Upload artifacts From aa558cc1192018324e6874218fbde63b8fd44248 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 6 Aug 2025 14:21:13 -0400 Subject: [PATCH 3/9] i guess --- .github/workflows/build-riscv64.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-riscv64.yml b/.github/workflows/build-riscv64.yml index f0a7eb358..ccae1c891 100644 --- a/.github/workflows/build-riscv64.yml +++ b/.github/workflows/build-riscv64.yml @@ -134,14 +134,14 @@ jobs: run: | aws s3 ls s3://download.chia.net/simple/chia-rs/ > existing_wheel_list_raw cat existing_wheel_list_raw - cat existing_wheel_list_raw | tr -s ' ' | cut -d ' ' -f 4 > existing_wheel_list + tr -s ' ' < existing_wheel_list_raw | cut -d ' ' -f 4 > existing_wheel_list - name: List new wheels if: env.RELEASE == 'true' shell: sh run: | (cd target/wheels/; ls chia_rs-*.whl) > new_wheel_list - cat new_wheel_list | xargs -I % sh -c 'ls -l target/wheels/%' + xargs -I % sh -c 'ls -l target/wheels/%' < new_wheel_list - name: Choose wheels to upload if: env.RELEASE == 'true' @@ -154,4 +154,4 @@ jobs: if: env.RELEASE == 'true' shell: sh run: | - cat upload_wheel_list | xargs -I % sh -c 'aws s3 cp target/wheels/% s3://download.chia.net/simple/chia-rs/' + xargs -I % sh -c 'aws s3 cp target/wheels/% s3://download.chia.net/simple/chia-rs/' < upload_wheel_list From b7b383b0c5438fac95343d866b1be5dadf2de6f6 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 6 Aug 2025 14:28:28 -0400 Subject: [PATCH 4/9] Revert "i guess" This reverts commit aa558cc1192018324e6874218fbde63b8fd44248. --- .github/workflows/build-riscv64.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-riscv64.yml b/.github/workflows/build-riscv64.yml index ccae1c891..f0a7eb358 100644 --- a/.github/workflows/build-riscv64.yml +++ b/.github/workflows/build-riscv64.yml @@ -134,14 +134,14 @@ jobs: run: | aws s3 ls s3://download.chia.net/simple/chia-rs/ > existing_wheel_list_raw cat existing_wheel_list_raw - tr -s ' ' < existing_wheel_list_raw | cut -d ' ' -f 4 > existing_wheel_list + cat existing_wheel_list_raw | tr -s ' ' | cut -d ' ' -f 4 > existing_wheel_list - name: List new wheels if: env.RELEASE == 'true' shell: sh run: | (cd target/wheels/; ls chia_rs-*.whl) > new_wheel_list - xargs -I % sh -c 'ls -l target/wheels/%' < new_wheel_list + cat new_wheel_list | xargs -I % sh -c 'ls -l target/wheels/%' - name: Choose wheels to upload if: env.RELEASE == 'true' @@ -154,4 +154,4 @@ jobs: if: env.RELEASE == 'true' shell: sh run: | - xargs -I % sh -c 'aws s3 cp target/wheels/% s3://download.chia.net/simple/chia-rs/' < upload_wheel_list + cat upload_wheel_list | xargs -I % sh -c 'aws s3 cp target/wheels/% s3://download.chia.net/simple/chia-rs/' From a3637f8e84543db90202232fc58760a3d8bcc467 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 6 Aug 2025 14:28:54 -0400 Subject: [PATCH 5/9] .shellcheckrc instead --- .shellcheckrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .shellcheckrc diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 000000000..6eccb2a81 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1 @@ +disable=SC2002 From 2a8ebd910449e9e9261bd174c9cd4647219ade2b Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Wed, 6 Aug 2025 14:47:22 -0400 Subject: [PATCH 6/9] or this --- .github/workflows/build-riscv64.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-riscv64.yml b/.github/workflows/build-riscv64.yml index f0a7eb358..43b447d40 100644 --- a/.github/workflows/build-riscv64.yml +++ b/.github/workflows/build-riscv64.yml @@ -134,6 +134,7 @@ jobs: run: | aws s3 ls s3://download.chia.net/simple/chia-rs/ > existing_wheel_list_raw cat existing_wheel_list_raw + # shellcheck disable=SC2002 cat existing_wheel_list_raw | tr -s ' ' | cut -d ' ' -f 4 > existing_wheel_list - name: List new wheels @@ -141,6 +142,7 @@ jobs: shell: sh run: | (cd target/wheels/; ls chia_rs-*.whl) > new_wheel_list + # shellcheck disable=SC2002 cat new_wheel_list | xargs -I % sh -c 'ls -l target/wheels/%' - name: Choose wheels to upload @@ -154,4 +156,5 @@ jobs: if: env.RELEASE == 'true' shell: sh run: | + # shellcheck disable=SC2002 cat upload_wheel_list | xargs -I % sh -c 'aws s3 cp target/wheels/% s3://download.chia.net/simple/chia-rs/' From 1c8e42c93f673756a7354603a3ea6fbc9ef4ad98 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Thu, 21 Aug 2025 11:03:46 -0400 Subject: [PATCH 7/9] Update build-wheels.yml --- .github/workflows/build-wheels.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-wheels.yml b/.github/workflows/build-wheels.yml index b4ecad0ba..46be4ca24 100644 --- a/.github/workflows/build-wheels.yml +++ b/.github/workflows/build-wheels.yml @@ -312,6 +312,8 @@ jobs: actionlint: runs-on: ubuntu-latest + permissions: + contents: none steps: - uses: actions/checkout@v4 From 8e9d932aa5cde6e47066cd9af3ec4af33acafce6 Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Thu, 21 Aug 2025 11:10:56 -0400 Subject: [PATCH 8/9] fixup --- .github/workflows/build-crate.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-crate.yml b/.github/workflows/build-crate.yml index d841771c6..3b078c2e5 100644 --- a/.github/workflows/build-crate.yml +++ b/.github/workflows/build-crate.yml @@ -104,4 +104,4 @@ jobs: run: | cd crates/"${{ matrix.package.name }}" python -m pip install blspy - cargo fuzz list | xargs -I "%" sh -c "cargo +"${{ matrix.toolchain }}" fuzz run % -- -max_total_time=${{ matrix.max_total_time}} || exit 255" + cargo fuzz list | xargs -I "%" sh -c "cargo +'${{ matrix.toolchain }}' fuzz run % -- -max_total_time=${{ matrix.max_total_time}} || exit 255" From feaf63cba758d5ac83117142458465b49276dcdc Mon Sep 17 00:00:00 2001 From: Kyle Altendorf Date: Mon, 25 Aug 2025 09:05:22 -0400 Subject: [PATCH 9/9] fixup --- .github/workflows/build-crate.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-crate.yml b/.github/workflows/build-crate.yml index 6c6ddae93..eeee07ac3 100644 --- a/.github/workflows/build-crate.yml +++ b/.github/workflows/build-crate.yml @@ -73,6 +73,9 @@ jobs: matrix: package: - name: chia-consensus + env: + # EXAMPLE_ as an example and to appease actionlint + EXAMPLE_LSAN_OPTIONS: detect_leaks=0 - name: chia-bls - name: clvm-utils - name: chia-protocol