diff --git a/.github/actions/rust-toolchain@oldest-supported/action.yml b/.github/actions/rust-toolchain@oldest-supported/action.yml new file mode 100644 index 000000000..cbdfe382b --- /dev/null +++ b/.github/actions/rust-toolchain@oldest-supported/action.yml @@ -0,0 +1,22 @@ +name: Oldest Supported Rust Toolchain + +on: + workflow_call: + inputs: + targets: + description: Comma-separated list of target triples to install for this toolchain + required: false + components: + description: Comma-separated list of components to be additionally installed + required: false + +permissions: + contents: read + +runs: + using: "composite" + steps: + - uses: dtolnay/rust-toolchain@1.70 + with: + targets: ${{ inputs.targets }} + components: ${{ inputs.components}} diff --git a/.github/actions/rust-toolchain@stable/action.yml b/.github/actions/rust-toolchain@stable/action.yml new file mode 100644 index 000000000..6b428c610 --- /dev/null +++ b/.github/actions/rust-toolchain@stable/action.yml @@ -0,0 +1,22 @@ +name: Stable Rust Toolchain + +on: + workflow_call: + inputs: + targets: + description: Comma-separated list of target triples to install for this toolchain + required: false + components: + description: Comma-separated list of components to be additionally installed + required: false + +permissions: + contents: read + +runs: + using: "composite" + steps: + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ inputs.targets }} + components: ${{ inputs.components }} diff --git a/.github/workflows/mac_codesign.yml b/.github/workflows/mac_codesign.yml index 10ebbaa58..7235226b1 100644 --- a/.github/workflows/mac_codesign.yml +++ b/.github/workflows/mac_codesign.yml @@ -9,12 +9,12 @@ jobs: environment: macos-codesign steps: - uses: actions/checkout@v4 - - name: Install Rust 1.73.0 - uses: dtolnay/rust-toolchain@1.73.0 + - name: Install Rust + uses: ./.github/actions/rust-toolchain@oldest-supported with: targets: x86_64-apple-darwin - name: Install Rust Stable - uses: dtolnay/rust-toolchain@stable + uses: ./.github/actions/rust-toolchain@stable with: targets: aarch64-apple-darwin - name: build-and-codesign diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 532355eb0..75ae68e6d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.70 + - uses: ./.github/actions/rust-toolchain@oldest-supported - name: Install deps run: | sudo apt install gettext libpcre2-dev python3-pexpect python3-sphinx tmux @@ -47,7 +47,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.70 + - uses: ./.github/actions/rust-toolchain@oldest-supported with: targets: "i586-unknown-linux-gnu" # rust-toolchain wants this comma-separated - name: Install deps @@ -128,7 +128,7 @@ jobs: # # steps: # - uses: actions/checkout@v4 - # - uses: dtolnay/rust-toolchain@1.70 + # - uses: ./.github/actions/rust-toolchain@oldest-supported # - name: Install deps # run: | # sudo apt install gettext libpcre2-dev python3-pexpect tmux @@ -156,7 +156,7 @@ jobs: CARGO_NET_GIT_FETCH_WITH_CLI: true steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.70 + - uses: ./.github/actions/rust-toolchain@oldest-supported - name: Install deps run: | # --break-system-packages because homebrew has now declared itself "externally managed". diff --git a/.github/workflows/rust_checks.yml b/.github/workflows/rust_checks.yml index d102ce1ef..cf27bbe36 100644 --- a/.github/workflows/rust_checks.yml +++ b/.github/workflows/rust_checks.yml @@ -11,7 +11,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable + - uses: ./.github/actions/rust-toolchain@stable + with: + components: rustfmt - name: cargo fmt run: cargo fmt --check @@ -20,7 +22,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable + - uses: ./.github/actions/rust-toolchain@stable + with: + components: clippy - name: Install deps run: | sudo apt install gettext libpcre2-dev @@ -37,18 +41,10 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable + - uses: ./.github/actions/rust-toolchain@stable - name: cargo doc run: | RUSTDOCFLAGS='-D warnings' cargo doc --workspace - name: cargo doctest run: | cargo test --doc --workspace - - # Disabling for now because it also checks "advisories", - # making CI fail for reasons unrelated to the patch - # cargo-deny: - # runs-on: ubuntu-latest - # steps: - # - uses: actions/checkout@v3 - # - uses: EmbarkStudios/cargo-deny-action@v1 diff --git a/.github/workflows/staticbuild.yml b/.github/workflows/staticbuild.yml index 41aa95264..3b0b5500d 100644 --- a/.github/workflows/staticbuild.yml +++ b/.github/workflows/staticbuild.yml @@ -16,7 +16,7 @@ jobs: contents: read steps: - - uses: dtolnay/rust-toolchain@1.70 + - uses: ./.github/actions/rust-toolchain@oldest-supported - uses: actions/checkout@v4 with: fetch-depth: 0 @@ -51,7 +51,7 @@ jobs: contents: read steps: - - uses: dtolnay/rust-toolchain@1.70 + - uses: ./.github/actions/rust-toolchain@oldest-supported - uses: actions/checkout@v4 with: fetch-depth: 0 diff --git a/build_tools/make_pkg.sh b/build_tools/make_pkg.sh index 5e561c2a9..782e1e848 100755 --- a/build_tools/make_pkg.sh +++ b/build_tools/make_pkg.sh @@ -30,7 +30,7 @@ X86_64_DEPLOY_TARGET='MACOSX_DEPLOYMENT_TARGET=10.9' # The first supported version of macOS on arm64 is 10.15, so any Rust is fine for arm64. # We wish to support back to 10.9 on x86-64; the last version of Rust to support that is # version 1.73.0. -RUST_VERSION_X86_64=1.73.0 +RUST_VERSION_X86_64=1.70.0 while getopts "sf:i:p:e:nj:" opt; do case $opt in