dtolnay / rustversion

Conditional compilation according to rustc compiler version
Apache License 2.0
326 stars 15 forks source link

Github Actions CI w/ action-rs/toolchain is not setting rustversion properly #25

Closed chipsenkbeil closed 3 years ago

chipsenkbeil commented 3 years ago

For my project entity-rs, I have a single CI.yml workflow that has a setup like this:

Screen Shot 2021-01-06 at 10 35 05 AM

In my macro crate within the project, I'm using trybuild in my tests and - like I'd seen in discussions on Github - have it set to only run when the Rust version is nightly:

Screen Shot 2021-01-06 at 10 36 35 AM

This works great if I run cargo +nightly test from within entity-rs/entity_macros or if I run cargo +nightly test --workspace from the root of entity-rs, but for whatever reason my Github action continues to mark the UI tests as ignore for nightly versions of Rust:

Screen Shot 2021-01-06 at 10 38 19 AM

Is there something else I need to configure on the CI-side? Or maybe I misunderstood something? I've been trying to read through different sources where people are using rustversion in combination with trybuild and haven't noticed anything yet.

taiki-e commented 3 years ago
     - uses: actions-rs/toolchain@v1
       with:
         toolchain: ${{ matrix.rust }}

IIRC, actions-rs/toolchain does not override the default toolchain. You need to use override: true or default: true. See also https://github.com/actions-rs/toolchain/blob/master/README.md#inputs

chipsenkbeil commented 3 years ago

Ah, didn't realize that. I'll close this out. Thanks!