change(ci): Build the crate target by itself in ci-build-crates.yml (#8042)
* Also build just the crate target in ci-build-crates.yml * Run 3 jobs in parallel and run zebrad first * Actually sort the jobs
This commit is contained in:
parent
5d80c646fe
commit
ba58d637d9
|
|
@ -61,17 +61,18 @@ jobs:
|
||||||
# This step is meant to dynamically create a JSON containing the values of each crate
|
# 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.
|
# 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,
|
# The result from `cargo tree` is then sorted so the longest job (zebrad) runs first,
|
||||||
# and separated by commas, then added to a `crates.txt` and assigned to a $JSON_CRATES variable.
|
# 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
|
# A JSON object is created and assigned to a $MATRIX variable, which is use to create an
|
||||||
# named `matrix`, which is then used as the input in following steps,
|
# output named `matrix`, which is then used as the input in following steps,
|
||||||
# using ` ${{ fromJson(needs.matrix.outputs.matrix) }}`
|
# using ` ${{ fromJson(needs.matrix.outputs.matrix) }}`
|
||||||
- id: set-matrix
|
- id: set-matrix
|
||||||
name: Dynamically build crates JSON
|
name: Dynamically build crates JSON
|
||||||
run: |
|
run: |
|
||||||
TEMP_DIR=$(mktemp -d)
|
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=$( (
|
MATRIX=$( (
|
||||||
echo '{ "crate" : ['
|
echo '{ "crate" : ['
|
||||||
echo "$(cat $TEMP_DIR/crates.txt)"
|
echo "$(cat $TEMP_DIR/crates.txt)"
|
||||||
|
|
@ -104,8 +105,9 @@ jobs:
|
||||||
# Some of these builds take more than 14GB disk space
|
# Some of these builds take more than 14GB disk space
|
||||||
runs-on: ubuntu-latest-m
|
runs-on: ubuntu-latest-m
|
||||||
strategy:
|
strategy:
|
||||||
# avoid rate-limit errors by only launching a few of these jobs at a time
|
# avoid rate-limit errors by only launching a few of these jobs at a time,
|
||||||
max-parallel: 2
|
# but still finish in a similar time to the longest tests
|
||||||
|
max-parallel: 3
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
|
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
|
||||||
|
|
||||||
|
|
@ -131,17 +133,28 @@ jobs:
|
||||||
# but it's faster to run these commands sequentially, so they can re-use the local cargo cache.
|
# 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 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
|
- 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: |
|
run: |
|
||||||
cargo clippy --package ${{ matrix.crate }} --no-default-features --all-targets -- -D warnings
|
cargo clippy --package ${{ matrix.crate }} --no-default-features --all-targets -- -D warnings
|
||||||
cargo build --package ${{ matrix.crate }} --no-default-features --all-targets
|
cargo build --package ${{ matrix.crate }} --no-default-features --all-targets
|
||||||
|
|
||||||
- name: Build ${{ matrix.crate }} crate with default features
|
- 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: |
|
run: |
|
||||||
cargo clippy --package ${{ matrix.crate }} --all-targets -- -D warnings
|
cargo clippy --package ${{ matrix.crate }} --all-targets -- -D warnings
|
||||||
cargo build --package ${{ matrix.crate }} --all-targets
|
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: |
|
run: |
|
||||||
cargo clippy --package ${{ matrix.crate }} --all-features --all-targets -- -D warnings
|
cargo clippy --package ${{ matrix.crate }} --all-features --all-targets -- -D warnings
|
||||||
cargo build --package ${{ matrix.crate }} --all-features --all-targets
|
cargo build --package ${{ matrix.crate }} --all-features --all-targets
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue