diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 80714303e7..f0debd5d7e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -13,6 +13,7 @@ on: - main - release/* - stable + workflow_dispatch: schedule: - cron: "30 0 * * 1,3,5" # At 00:30 UTC on Monday, Wednesday, and Friday @@ -22,7 +23,7 @@ jobs: # Do not edit this file in .github/workflows build-windows-pr: # job-name skip-main skip-stable runs-on: ${{ matrix.os || 'windows-latest' }} - if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} # skip-main skip-stable + if: ${{ contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) }} # skip-main skip-stable env: RUSTFLAGS: -Ctarget-feature=+crt-static RUST_MIN_STACK: 16777216 @@ -366,7 +367,7 @@ jobs: # Do not edit this file in .github/workflows build-windows-stable: # job-name skip-main skip-pr runs-on: ${{ matrix.os || 'windows-latest' }} - if: ${{ github.event_name == 'push' && github.ref_name == 'stable' || github.event_name == 'schedule' }} # skip-pr skip-main + if: ${{ github.event_name == 'push' && github.ref_name == 'stable' || contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }} # skip-pr skip-main env: RUSTFLAGS: -Ctarget-feature=+crt-static RUST_MIN_STACK: 16777216 @@ -544,7 +545,7 @@ jobs: # Do not edit this file in .github/workflows build-linux-pr: # job-name skip-main skip-stable runs-on: ${{ matrix.os || 'ubuntu-latest' }} - if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} # skip-main skip-stable + if: ${{ contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) }} # skip-main skip-stable permissions: id-token: write contents: read @@ -886,7 +887,7 @@ jobs: # Do not edit this file in .github/workflows build-linux-stable: # job-name skip-main skip-pr runs-on: ${{ matrix.os || 'ubuntu-latest' }} - if: ${{ github.event_name == 'push' && github.ref_name == 'stable' || github.event_name == 'schedule' }} # skip-pr skip-main + if: ${{ github.event_name == 'push' && github.ref_name == 'stable' || contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }} # skip-pr skip-main permissions: id-token: write contents: read @@ -1346,7 +1347,7 @@ jobs: # Do not edit this file in .github/workflows build-freebsd-main: # job-name skip-stable runs-on: ubuntu-latest - if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || startsWith(github.ref_name, 'release/'))) || github.event_name == 'schedule' }} # skip-stable + if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || startsWith(github.ref_name, 'release/'))) || contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }} # skip-stable steps: - uses: actions/checkout@v6 with: @@ -1498,7 +1499,7 @@ jobs: # templating and so on. build-all-features: # job-name runs-on: ${{ matrix.os }} - if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} + if: ${{ contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) }} strategy: fail-fast: false matrix: @@ -1564,7 +1565,7 @@ jobs: with: tool: mdbook@${{ env.MDBOOK_VERSION }} - name: Build user-guide (stable) - if: ${{ !contains('["pull_request", "merge_group"]', github.event_name) }} + if: ${{ !contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) }} run: | git checkout stable # Support both old and new directory structure during the transition @@ -1586,7 +1587,7 @@ jobs: mkdir -p ${{ runner.temp }}/book mv book ${{ runner.temp }}/book/dev-guide - name: Deploy to GitHub - if: ${{ !contains('["pull_request", "merge_group"]', github.event_name) && !startsWith(github.ref_name, 'release/') }} + if: ${{ !contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) && !startsWith(github.ref_name, 'release/') }} run: | cd ${{ runner.temp }}/book git config --global init.defaultBranch main diff --git a/ci/actions-templates/all-features-template.yaml b/ci/actions-templates/all-features-template.yaml index 14e36699b6..3370531fa6 100644 --- a/ci/actions-templates/all-features-template.yaml +++ b/ci/actions-templates/all-features-template.yaml @@ -9,7 +9,7 @@ jobs: # skip-all # templating and so on. build-all-features: # job-name runs-on: ${{ matrix.os }} - if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} + if: ${{ contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) }} strategy: fail-fast: false matrix: diff --git a/ci/actions-templates/freebsd-builds-template.yaml b/ci/actions-templates/freebsd-builds-template.yaml index 689c6c8ef4..c5ff819539 100644 --- a/ci/actions-templates/freebsd-builds-template.yaml +++ b/ci/actions-templates/freebsd-builds-template.yaml @@ -5,7 +5,7 @@ jobs: # skip-main skip-stable build-freebsd-main: # job-name skip-stable build-freebsd-stable: # job-name skip-main runs-on: ubuntu-latest - if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || startsWith(github.ref_name, 'release/'))) || github.event_name == 'schedule' }} # skip-stable + if: ${{ (github.event_name == 'push' && (github.ref_name == 'main' || startsWith(github.ref_name, 'release/'))) || contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }} # skip-stable if: ${{ github.event_name == 'push' && github.ref_name == 'stable' }} # skip-main steps: - uses: actions/checkout@v6 diff --git a/ci/actions-templates/gen-workflows.sh b/ci/actions-templates/gen-workflows.sh index 7cfb7f1297..b4985a9c2b 100755 --- a/ci/actions-templates/gen-workflows.sh +++ b/ci/actions-templates/gen-workflows.sh @@ -23,6 +23,7 @@ on: - main - release/* - stable + workflow_dispatch: schedule: - cron: "30 0 * * 1,3,5" # At 00:30 UTC on Monday, Wednesday, and Friday diff --git a/ci/actions-templates/linux-builds-template.yaml b/ci/actions-templates/linux-builds-template.yaml index e312f98403..bbb71efc91 100644 --- a/ci/actions-templates/linux-builds-template.yaml +++ b/ci/actions-templates/linux-builds-template.yaml @@ -6,9 +6,9 @@ jobs: # skip-main skip-pr skip-stable build-linux-main: # job-name skip-pr skip-stable build-linux-stable: # job-name skip-main skip-pr runs-on: ${{ matrix.os || 'ubuntu-latest' }} - if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} # skip-main skip-stable + if: ${{ contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) }} # skip-main skip-stable if: ${{ github.event_name == 'push' && (github.ref_name == 'main' || startsWith(github.ref_name, 'release/')) }} # skip-pr skip-stable - if: ${{ github.event_name == 'push' && github.ref_name == 'stable' || github.event_name == 'schedule' }} # skip-pr skip-main + if: ${{ github.event_name == 'push' && github.ref_name == 'stable' || contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }} # skip-pr skip-main permissions: id-token: write contents: read diff --git a/ci/actions-templates/test-docs-template.yaml b/ci/actions-templates/test-docs-template.yaml index 11def186ca..ae8e9abdaa 100644 --- a/ci/actions-templates/test-docs-template.yaml +++ b/ci/actions-templates/test-docs-template.yaml @@ -19,7 +19,7 @@ jobs: # skip-all with: tool: mdbook@${{ env.MDBOOK_VERSION }} - name: Build user-guide (stable) - if: ${{ !contains('["pull_request", "merge_group"]', github.event_name) }} + if: ${{ !contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) }} run: | git checkout stable # Support both old and new directory structure during the transition @@ -41,7 +41,7 @@ jobs: # skip-all mkdir -p ${{ runner.temp }}/book mv book ${{ runner.temp }}/book/dev-guide - name: Deploy to GitHub - if: ${{ !contains('["pull_request", "merge_group"]', github.event_name) && !startsWith(github.ref_name, 'release/') }} + if: ${{ !contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) && !startsWith(github.ref_name, 'release/') }} run: | cd ${{ runner.temp }}/book git config --global init.defaultBranch main diff --git a/ci/actions-templates/windows-builds-template.yaml b/ci/actions-templates/windows-builds-template.yaml index 0d54398815..68c5a1bb1e 100644 --- a/ci/actions-templates/windows-builds-template.yaml +++ b/ci/actions-templates/windows-builds-template.yaml @@ -6,9 +6,9 @@ jobs: # skip-main skip-pr skip-stable build-windows-main: # job-name skip-pr skip-stable build-windows-stable: # job-name skip-main skip-pr runs-on: ${{ matrix.os || 'windows-latest' }} - if: ${{ contains('["pull_request", "merge_group"]', github.event_name) }} # skip-main skip-stable + if: ${{ contains(fromJSON('["pull_request", "merge_group"]'), github.event_name) }} # skip-main skip-stable if: ${{ github.event_name == 'push' && (github.ref_name == 'main' || startsWith(github.ref_name, 'release/')) }} # skip-pr skip-stable - if: ${{ github.event_name == 'push' && github.ref_name == 'stable' || github.event_name == 'schedule' }} # skip-pr skip-main + if: ${{ github.event_name == 'push' && github.ref_name == 'stable' || contains(fromJSON('["schedule", "workflow_dispatch"]'), github.event_name) }} # skip-pr skip-main env: RUSTFLAGS: -Ctarget-feature=+crt-static RUST_MIN_STACK: 16777216 diff --git a/src/dist/manifestation.rs b/src/dist/manifestation.rs index c620b0184b..174307d5fd 100644 --- a/src/dist/manifestation.rs +++ b/src/dist/manifestation.rs @@ -244,13 +244,12 @@ impl Manifestation { } if !components.is_empty() { - if components.len() > 2 { - info!("downloading {} components", components.len()); - } else { - info!( + match &components[..] { + [c] => info!( "downloading component {}", - components[0].manifest.short_name(&components[0].component), - ); + c.manifest.short_name(&c.component), + ), + _ => info!("downloading {} components", components.len()), }; let mut stream = InstallEvents::new(components.into_iter(), Arc::new(self)); diff --git a/tests/suite/cli_rustup.rs b/tests/suite/cli_rustup.rs index 18eb63c305..f67d5f0d8e 100644 --- a/tests/suite/cli_rustup.rs +++ b/tests/suite/cli_rustup.rs @@ -3889,7 +3889,7 @@ async fn custom_toolchain_with_components_toolchains_profile_does_not_err() { .with_stderr(snapbox::str![[r#" info: syncing channel updates for nightly-[HOST_TRIPLE] info: latest update on 2015-01-02 for version 1.3.0 (hash-nightly-2) -info: downloading component cargo +info: downloading 2 components info: default toolchain set to nightly-[HOST_TRIPLE] "#]])