-
Notifications
You must be signed in to change notification settings - Fork 80
61 lines (58 loc) · 2.2 KB
/
Copy pathworkspace-hack.yml
File metadata and controls
61 lines (58 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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