Skip to content

Commit

Permalink
Merge branch 'main' into scannin-tests-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 authored Dec 5, 2023
2 parents b0bdf17 + ba58d63 commit a1bf2d0
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 29 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cd-deploy-nodes-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down Expand Up @@ -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 }}'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/chore-delete-gcp-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down Expand Up @@ -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 }}'
Expand Down
37 changes: 25 additions & 12 deletions .github/workflows/ci-build-crates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
Expand Down Expand Up @@ -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) }}

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs-deploy-firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down Expand Up @@ -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 }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-zcashd-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sub-build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sub-build-lightwalletd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/sub-deploy-integration-tests-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down Expand Up @@ -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 }}'
Expand Down Expand Up @@ -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 }}'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sub-find-cached-disks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}'
Expand Down
8 changes: 4 additions & 4 deletions zebra-network/src/address_book.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Item = MetaAddr> + DoubleEndedIterator + '_ {
pub fn peers(&'_ self) -> impl DoubleEndedIterator<Item = MetaAddr> + '_ {
let _guard = self.span.enter();
self.by_addr.descending_values().cloned()
}
Expand Down Expand Up @@ -590,7 +590,7 @@ impl AddressBook {
&'_ self,
instant_now: Instant,
chrono_now: chrono::DateTime<Utc>,
) -> impl Iterator<Item = MetaAddr> + DoubleEndedIterator + '_ {
) -> impl DoubleEndedIterator<Item = MetaAddr> + '_ {
let _guard = self.span.enter();

// Skip live peers, and peers pending a reconnect attempt.
Expand All @@ -609,7 +609,7 @@ impl AddressBook {
pub fn state_peers(
&'_ self,
state: PeerAddrState,
) -> impl Iterator<Item = MetaAddr> + DoubleEndedIterator + '_ {
) -> impl DoubleEndedIterator<Item = MetaAddr> + '_ {
let _guard = self.span.enter();

self.by_addr
Expand All @@ -624,7 +624,7 @@ impl AddressBook {
&'_ self,
instant_now: Instant,
chrono_now: chrono::DateTime<Utc>,
) -> impl Iterator<Item = MetaAddr> + DoubleEndedIterator + '_ {
) -> impl DoubleEndedIterator<Item = MetaAddr> + '_ {
let _guard = self.span.enter();

self.by_addr
Expand Down

0 comments on commit a1bf2d0

Please sign in to comment.