Skip to content

Misc DX improvements for contributors #1060

Misc DX improvements for contributors

Misc DX improvements for contributors #1060

Workflow file for this run

name: Workspace hack
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions-rust-lang/setup-rust-toolchain@v1
# Check https://docs.rs/cargo-hakari/0.9.29/cargo_hakari/#installation
# to learn how to install cargo-hakari locally
- name: Install cargo-hakari
uses: taiki-e/install-action@v2
with:
tool: cargo-hakari
- name: Verify workspace-hack
id: verify_libs
continue-on-error: true
run: |
# If the hack crate has been disabled (probably for a release)
# we don't check anything else
if ! cargo hakari disable --diff ; then
# Check that px_workspace_hack's Cargo.toml is up-to-date
# If this fails, run `cargo hakari generate` to fix it
cargo hakari generate --diff
# Check that all workspace crates depend on px_workspace_hack
# If this fails, run `cargo hakari manage-deps` to fix it
cargo hakari manage-deps --dry-run
fi
- name: Verify workspace-hack in docs/examples
id: verify_examples
continue-on-error: true
run: |
cd docs/examples
# If the hack crate has been disabled (probably for a release)
# we don't check anything else
if ! cargo hakari disable --diff ; then
# Check that px_workspace_hack's Cargo.toml is up-to-date
# If this fails, run `cargo hakari generate` to fix it
cargo hakari generate --diff
# Check that all workspace crates depend on px_workspace_hack
# If this fails, run `cargo hakari manage-deps` to fix it
cargo hakari manage-deps --dry-run
fi
- name: Fail if any verification failed
if: steps.verify_libs.outcome == 'failure' || steps.verify_examples.outcome == 'failure'
run: |
echo "Verify workspace-hack for published libs: ${{ steps.verify_libs.outcome }}"
echo "Verify workspace-hack in examples: ${{ steps.verify_examples.outcome }}"
exit 1