Skip to content

Commit

Permalink
ci(CI-pr): run unit and documentation tests in stable toolchain job
Browse files Browse the repository at this point in the history
  • Loading branch information
SanchithHegde committed May 23, 2024
1 parent 362e7ab commit 45e1970
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/CI-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,11 @@ jobs:
tool: cargo-hack
checksum: true

# - name: Install cargo-nextest
# uses: taiki-e/[email protected]
# with:
# tool: cargo-nextest
# checksum: true
- name: Install cargo-nextest
uses: taiki-e/[email protected]
with:
tool: cargo-nextest
checksum: true

# - name: Setup Embark Studios lint rules
# shell: bash
Expand Down Expand Up @@ -341,6 +341,23 @@ jobs:
echo '::endgroup::'
done
- name: Run unit and documentation tests
shell: bash
# `cargo` does not allow us to exclude specific features from all features,
# so we're using `cargo metadata` to obtain all features from all workspace crates
# and exclude specific features from the list.
run: |
FEATURES=$(cargo metadata --all-features --format-version 1 | \
jq -r '
[ ( .workspace_members | sort ) as $package_ids # Store workspace crate package IDs in `package_ids` array
| .packages[] | select( IN(.id; $package_ids[]) ) | .features | keys[] ] | unique # Select all unique features from all workspace crates
| del( .[] | select( any( . ; . == ("aws_kms", "aws_s3", "release") ) ) ) # Exclude some features from features list
| join(",") # Construct a comma-separated string of features for passing to `cargo`
')
cargo nextest run --config-file .github/nextest.toml --profile ci -E 'kind(lib)' --features "${FEATURES}"
cargo test --doc --features "${FEATURES}"
typos:
name: Spell check
runs-on: ubuntu-latest
Expand Down

0 comments on commit 45e1970

Please sign in to comment.