diff --git a/.github/workflows/cd-deploy-nodes-gcp.yml b/.github/workflows/cd-deploy-nodes-gcp.yml index f21f3212cc2..9515a4244f1 100644 --- a/.github/workflows/cd-deploy-nodes-gcp.yml +++ b/.github/workflows/cd-deploy-nodes-gcp.yml @@ -216,7 +216,7 @@ jobs: # Setup gcloud CLI - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v1.2.0 + uses: google-github-actions/auth@v2.0.0 with: retries: '3' workload_identity_provider: '${{ vars.GCP_WIF }}' @@ -318,7 +318,7 @@ jobs: # Setup gcloud CLI - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v1.2.0 + uses: google-github-actions/auth@v2.0.0 with: retries: '3' workload_identity_provider: '${{ vars.GCP_WIF }}' diff --git a/.github/workflows/chore-delete-gcp-resources.yml b/.github/workflows/chore-delete-gcp-resources.yml index 42ccc84d40e..9291796a041 100644 --- a/.github/workflows/chore-delete-gcp-resources.yml +++ b/.github/workflows/chore-delete-gcp-resources.yml @@ -37,7 +37,7 @@ jobs: # Setup gcloud CLI - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v1.2.0 + uses: google-github-actions/auth@v2.0.0 with: retries: '3' workload_identity_provider: '${{ vars.GCP_WIF }}' @@ -246,7 +246,7 @@ jobs: # Setup gcloud CLI - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v1.2.0 + uses: google-github-actions/auth@v2.0.0 with: retries: '3' workload_identity_provider: '${{ vars.GCP_WIF }}' diff --git a/.github/workflows/ci-build-crates.yml b/.github/workflows/ci-build-crates.yml index a5aa0c6d65c..4e92a54ad92 100644 --- a/.github/workflows/ci-build-crates.yml +++ b/.github/workflows/ci-build-crates.yml @@ -61,17 +61,18 @@ jobs: # This step is meant to dynamically create a JSON containing the values of each crate # available in this repo in the root directory. We use `cargo tree` to accomplish this task. # - # The result from `cargo tree` is then transform to JSON values between double quotes, - # and separated by commas, then added to a `crates.txt` and assigned to a $JSON_CRATES variable. + # The result from `cargo tree` is then sorted so the longest job (zebrad) runs first, + # transformed to JSON values between double quotes, and separated by commas, + # then added to a `crates.txt`. # - # A JSON object is created and assigned to a $MATRIX variable, which is use to create an output - # named `matrix`, which is then used as the input in following steps, + # A JSON object is created and assigned to a $MATRIX variable, which is use to create an + # output named `matrix`, which is then used as the input in following steps, # using ` ${{ fromJson(needs.matrix.outputs.matrix) }}` - id: set-matrix name: Dynamically build crates JSON run: | TEMP_DIR=$(mktemp -d) - echo "$(cargo tree --depth 0 --edges no-normal,no-dev,no-build,no-proc-macro --prefix none | cut -d ' ' -f1 | sed '/^$/d' | awk '{ printf "\"%s\",\n", $0 }' | sed '$ s/.$//')" > $TEMP_DIR/crates.txt + cargo tree --depth 0 --edges no-normal,no-dev,no-build,no-proc-macro --prefix none | cut -d ' ' -f1 | sed '/^$/d' | LC_ALL=C sort --reverse | awk '{ printf "\"%s\",\n", $0 }' | sed '$ s/.$//' > $TEMP_DIR/crates.txt MATRIX=$( ( echo '{ "crate" : [' echo "$(cat $TEMP_DIR/crates.txt)" @@ -104,8 +105,9 @@ jobs: # Some of these builds take more than 14GB disk space runs-on: ubuntu-latest-m strategy: - # avoid rate-limit errors by only launching a few of these jobs at a time - max-parallel: 2 + # avoid rate-limit errors by only launching a few of these jobs at a time, + # but still finish in a similar time to the longest tests + max-parallel: 3 fail-fast: true matrix: ${{ fromJson(needs.matrix.outputs.matrix) }} @@ -127,21 +129,32 @@ jobs: run: | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain=stable --profile=minimal - # We could use `features: ['', '--all-features', '--no-default-features']` as a matrix argument, - # but it's faster to run these commands sequentially, so they can re-use the local cargo cache. - # - # Some Zebra crates do not have any features, and most don't have any default features. + # We could use `features: ['', '--all-features', '--no-default-features']` as a matrix argument, + # but it's faster to run these commands sequentially, so they can re-use the local cargo cache. + # + # Some Zebra crates do not have any features, and most don't have any default features. + # Some targets activate features, but we still need to be able to build without them. - name: Build ${{ matrix.crate }} crate with no default features + run: | + cargo clippy --package ${{ matrix.crate }} --no-default-features -- -D warnings + cargo build --package ${{ matrix.crate }} --no-default-features + + - name: Build ${{ matrix.crate }} crate with no default features and all targets run: | cargo clippy --package ${{ matrix.crate }} --no-default-features --all-targets -- -D warnings cargo build --package ${{ matrix.crate }} --no-default-features --all-targets - name: Build ${{ matrix.crate }} crate with default features + run: | + cargo clippy --package ${{ matrix.crate }} -- -D warnings + cargo build --package ${{ matrix.crate }} + + - name: Build ${{ matrix.crate }} crate with default features and all targets run: | cargo clippy --package ${{ matrix.crate }} --all-targets -- -D warnings cargo build --package ${{ matrix.crate }} --all-targets - - name: Build ${{ matrix.crate }} crate with all features + - name: Build ${{ matrix.crate }} crate with all features and all targets run: | cargo clippy --package ${{ matrix.crate }} --all-features --all-targets -- -D warnings cargo build --package ${{ matrix.crate }} --all-features --all-targets diff --git a/.github/workflows/docs-deploy-firebase.yml b/.github/workflows/docs-deploy-firebase.yml index c939a69ccbf..a1095f59fd4 100644 --- a/.github/workflows/docs-deploy-firebase.yml +++ b/.github/workflows/docs-deploy-firebase.yml @@ -102,7 +102,7 @@ jobs: # Setup gcloud CLI - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v1.2.0 + uses: google-github-actions/auth@v2.0.0 with: retries: '3' workload_identity_provider: '${{ vars.GCP_WIF }}' @@ -161,7 +161,7 @@ jobs: # Setup gcloud CLI - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v1.2.0 + uses: google-github-actions/auth@v2.0.0 with: retries: '3' workload_identity_provider: '${{ vars.GCP_WIF }}' diff --git a/.github/workflows/manual-zcashd-deploy.yml b/.github/workflows/manual-zcashd-deploy.yml index 8ecafe79eb5..7bfb5cf70eb 100644 --- a/.github/workflows/manual-zcashd-deploy.yml +++ b/.github/workflows/manual-zcashd-deploy.yml @@ -45,7 +45,7 @@ jobs: # Setup gcloud CLI - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v1.2.0 + uses: google-github-actions/auth@v2.0.0 with: retries: '3' workload_identity_provider: '${{ vars.GCP_WIF }}' diff --git a/.github/workflows/sub-build-docker-image.yml b/.github/workflows/sub-build-docker-image.yml index 2b50e77e61b..27472777496 100644 --- a/.github/workflows/sub-build-docker-image.yml +++ b/.github/workflows/sub-build-docker-image.yml @@ -128,7 +128,7 @@ jobs: - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v1.2.0 + uses: google-github-actions/auth@v2.0.0 with: retries: '3' workload_identity_provider: '${{ vars.GCP_WIF }}' diff --git a/.github/workflows/sub-build-lightwalletd.yml b/.github/workflows/sub-build-lightwalletd.yml index bb06f0bb2b2..e30e2429378 100644 --- a/.github/workflows/sub-build-lightwalletd.yml +++ b/.github/workflows/sub-build-lightwalletd.yml @@ -111,7 +111,7 @@ jobs: # Setup gcloud CLI - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v1.2.0 + uses: google-github-actions/auth@v2.0.0 with: retries: '3' workload_identity_provider: '${{ vars.GCP_WIF }}' diff --git a/.github/workflows/sub-deploy-integration-tests-gcp.yml b/.github/workflows/sub-deploy-integration-tests-gcp.yml index 9b9b73ba72b..8cec4b302d8 100644 --- a/.github/workflows/sub-deploy-integration-tests-gcp.yml +++ b/.github/workflows/sub-deploy-integration-tests-gcp.yml @@ -150,7 +150,7 @@ jobs: # Setup gcloud CLI - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v1.2.0 + uses: google-github-actions/auth@v2.0.0 with: retries: '3' workload_identity_provider: '${{ vars.GCP_WIF }}' @@ -499,7 +499,7 @@ jobs: # Setup gcloud CLI - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v1.2.0 + uses: google-github-actions/auth@v2.0.0 with: workload_identity_provider: '${{ vars.GCP_WIF }}' service_account: '${{ vars.GCP_DEPLOYMENTS_SA }}' @@ -776,7 +776,7 @@ jobs: # Setup gcloud CLI - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v1.2.0 + uses: google-github-actions/auth@v2.0.0 with: workload_identity_provider: '${{ vars.GCP_WIF }}' service_account: '${{ vars.GCP_DEPLOYMENTS_SA }}' diff --git a/.github/workflows/sub-find-cached-disks.yml b/.github/workflows/sub-find-cached-disks.yml index a91dac4120a..2e81f760b28 100644 --- a/.github/workflows/sub-find-cached-disks.yml +++ b/.github/workflows/sub-find-cached-disks.yml @@ -38,7 +38,7 @@ jobs: # Setup gcloud CLI - name: Authenticate to Google Cloud id: auth - uses: google-github-actions/auth@v1.2.0 + uses: google-github-actions/auth@v2.0.0 with: retries: '3' workload_identity_provider: '${{ vars.GCP_WIF }}' diff --git a/zebra-network/src/address_book.rs b/zebra-network/src/address_book.rs index 50d18be2ada..c9d4d1ee57d 100644 --- a/zebra-network/src/address_book.rs +++ b/zebra-network/src/address_book.rs @@ -559,7 +559,7 @@ impl AddressBook { /// Return an iterator over all peers. /// /// Returns peers in reconnection attempt order, including recently connected peers. - pub fn peers(&'_ self) -> impl Iterator + DoubleEndedIterator + '_ { + pub fn peers(&'_ self) -> impl DoubleEndedIterator + '_ { let _guard = self.span.enter(); self.by_addr.descending_values().cloned() } @@ -590,7 +590,7 @@ impl AddressBook { &'_ self, instant_now: Instant, chrono_now: chrono::DateTime, - ) -> impl Iterator + DoubleEndedIterator + '_ { + ) -> impl DoubleEndedIterator + '_ { let _guard = self.span.enter(); // Skip live peers, and peers pending a reconnect attempt. @@ -609,7 +609,7 @@ impl AddressBook { pub fn state_peers( &'_ self, state: PeerAddrState, - ) -> impl Iterator + DoubleEndedIterator + '_ { + ) -> impl DoubleEndedIterator + '_ { let _guard = self.span.enter(); self.by_addr @@ -624,7 +624,7 @@ impl AddressBook { &'_ self, instant_now: Instant, chrono_now: chrono::DateTime, - ) -> impl Iterator + DoubleEndedIterator + '_ { + ) -> impl DoubleEndedIterator + '_ { let _guard = self.span.enter(); self.by_addr