Skip to content

Commit

Permalink
Merge branch 'main' into check-commit-ivk-result
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jun 28, 2022
2 parents e048efa + d4b9353 commit 786d2c2
Show file tree
Hide file tree
Showing 59 changed files with 1,827 additions and 635 deletions.
5 changes: 4 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ rustflags = [
"-Aclippy::try_err",

# Links in public docs can point to private items.
"-Arustdoc::private_intra_doc_links"
"-Arustdoc::private_intra_doc_links",

# Panics
"-Wclippy::fallible_impl_from",

# TODOs:
# `cargo fix` might help do these fixes,
Expand Down
69 changes: 69 additions & 0 deletions .github/workflows/build-crates-individually.patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build crates individually

# We need to keep the `matrix` job in this workflow as-is, as we need the results
# to actually match the same `build` job names from the original file.
on:
pull_request:
paths-ignore:
# production code and test code
- '**/*.rs'
# dependencies
- '**/Cargo.toml'
- '**/Cargo.lock'
# workflow definitions
- '.github/workflows/build-crates-individually.yml'

jobs:
matrix:
name: Crates matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/[email protected]

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- uses: actions-rs/[email protected]
# 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.
#
# 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
MATRIX=$( (
echo '{ "crate" : ['
echo "$(cat $TEMP_DIR/crates.txt)"
echo " ]}"
) | jq -c .)
echo $MATRIX
echo $MATRIX | jq .
echo "::set-output name=matrix::$MATRIX"
check-matrix:
runs-on: ubuntu-latest
needs: [ matrix ]
steps:
- run: 'echo "No job required"'

build:
name: Build ${{ matrix.crate }} crate
needs: [ matrix, check-matrix ]
runs-on: ubuntu-latest
strategy:
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}

steps:
- run: 'echo "No job required"'
125 changes: 125 additions & 0 deletions .github/workflows/build-crates-individually.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: Build crates individually

on:
workflow_dispatch:
push:
branches:
- main
paths:
# production code and test code
- '**/*.rs'
# dependencies
- '**/Cargo.toml'
- '**/Cargo.lock'
# workflow definitions
- '.github/workflows/build-crates-individually.yml'
pull_request:
paths:
# production code and test code
- '**/*.rs'
# dependencies
- '**/Cargo.toml'
- '**/Cargo.lock'
# workflow definitions
- '.github/workflows/build-crates-individually.yml'

env:
CARGO_INCREMENTAL: 0
RUST_BACKTRACE: full
RUST_LIB_BACKTRACE: full
COLORBT_SHOW_HIDDEN: '1'

jobs:
matrix:
name: Crates matrix
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/[email protected]

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

- uses: actions-rs/[email protected]
# 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.
#
# 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
MATRIX=$( (
echo '{ "crate" : ['
echo "$(cat $TEMP_DIR/crates.txt)"
echo " ]}"
) | jq -c .)
echo $MATRIX
echo $MATRIX | jq .
echo "::set-output name=matrix::$MATRIX"
check-matrix:
runs-on: ubuntu-latest
needs: [ matrix ]
steps:
- name: Install json2yaml
run: |
sudo npm install -g json2yaml
- name: Check matrix definition
run: |
matrix='${{ needs.matrix.outputs.matrix }}'
echo $matrix
echo $matrix | jq .
echo $matrix | json2yaml
build:
name: Build ${{ matrix.crate }} crate
needs: [ matrix, check-matrix ]
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}

steps:
- uses: actions/[email protected]
with:
persist-credentials: false

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true

# 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.
- name: Build ${{ matrix.crate }} crate with no default features
uses: actions-rs/[email protected]
with:
command: build
args: --package ${{ matrix.crate }} --no-default-features

- name: Build ${{ matrix.crate }} crate normally
uses: actions-rs/[email protected]
with:
command: build
args: --package ${{ matrix.crate }}

- name: Build ${{ matrix.crate }} crate with all features
uses: actions-rs/[email protected]
with:
command: build
args: --package ${{ matrix.crate }} --all-features
38 changes: 5 additions & 33 deletions .github/workflows/continous-integration-os.patch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,70 +14,42 @@ on:
jobs:
test:
name: Test ${{ matrix.rust }} on ${{ matrix.os }}
# The large timeout is to accommodate:
# - Windows builds (75 minutes, typically 30-50 minutes)
# - parameter downloads (40 minutes, but only when the cache expires)
timeout-minutes: 115
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# TODO: Windows was removed for now, see https://github.com/ZcashFoundation/zebra/issues/3801
os: [ubuntu-latest, macos-latest]
rust: [stable]

steps:
- run: 'echo "No build required"'

test-fake-activation-heights:
name: Test ${{ matrix.rust }} zebra-state with fake activation heights on ubuntu-latest
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable]

steps:
- run: 'echo "No build required"'

build-chain-no-features:
name: Build ${{ matrix.rust }} zebra-chain w/o features on ubuntu-latest
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable, beta]
exclude:
- os: macos-latest
rust: beta

steps:
- run: 'echo "No build required"'

install-from-lockfile-no-cache:
name: Install zebrad from lockfile without cache on ubuntu-latest
timeout-minutes: 60
runs-on: ubuntu-latest

steps:
- run: 'echo "No build required"'

check-cargo-lock:
name: Check Cargo.lock is up to date
timeout-minutes: 60
runs-on: ubuntu-latest

steps:
- run: 'echo "No build required"'

cargo-deny:
name: Check deny.toml ${{ matrix.checks }}
name: Check deny.toml ${{ matrix.checks }} ${{ matrix.features }}
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- bans
- sources

# Prevent sudden announcement of a new advisory from failing ci:
continue-on-error: ${{ matrix.checks == 'advisories' }}
features: ['', '--all-features', '--no-default-features']

steps:
- run: 'echo "No build required"'
Loading

0 comments on commit 786d2c2

Please sign in to comment.