Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(CI): add external type check #2957

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,30 @@ jobs:
with:
command: rustdoc
args: --features full,ffi -- --cfg docsrs --cfg hyper_unstable_ffi -D broken-intra-doc-links

check-external-types:
name: Check exposed types
needs: [style, test]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use the latest version of this action. Older versions of this action depend on node versions that are deprecated in Github's runners.

Suggested change
uses: actions/checkout@v1
uses: actions/checkout@v3


- name: Install Rust
uses: actions-rs/toolchain@v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This action is unmaintained. It seems like people are coalescing around dtolnay/rust-toolchain as an alternative solution.

with:
profile: minimal
toolchain: nightly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should pin to a specific combination of nightly version/cargo-check-external-types that's known to work. The newest nightly version might introduce a new version of rustdoc JSON output that's incompatible with the version expected by cargo-check-external-type.

It'd be nicer if we could install the toolchain version listed in their toolchain file, but that's probably not necessary to get this PR in.

override: true

- name: Install cargo-check-external-types
uses: actions-rs/install@v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as actions-rs/toolchain- I'd consider dtolnay/install instead.

with:
crate: cargo-check-external-types
version: 0.1.0
use-tool-cache: true

- name: check-external-types
uses: actions-rs/cargo@v1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue as the other actions-rs/* actions- I think here we can just invoke cargo manually.

with:
command: check-external-types