Skip to content

Nightly Deps Check #763

Nightly Deps Check

Nightly Deps Check #763

# Runs `cargo update` and then reports build failures in a GitHub issue titled "Nightly deps check failed"
# If an open issue with the same title already exists then another issue is not created.
name: Nightly Deps Check
on:
# Allows the workflow to be manually triggered from the github UI.
workflow_dispatch: {}
# Run once per day at 00:00 UTC
schedule:
- cron: '0 0 * * *'
env:
CARGO_TERM_COLOR: always
jobs:
build:
strategy:
matrix:
include:
- name: Release
cargo_profile: --release
- name: Debug
cargo_profile:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Swatinem/rust-cache@v2
with:
# rust-cache already handles all the sane defaults for caching rust builds.
# However because we are running seperate debug/release builds in parallel,
# we also need to add Debug or Release to the key so that a seperate cache is used.
# Otherwise only the last build to finish would get saved to the cache.
key: ${{ matrix.name }}
- name: Install cargo-hack
run: cargo install cargo-hack --version 0.6.22
- name: cargo update`
run: cargo update
- name: Check `cargo fmt` was run
run: cargo fmt --all -- --check
# If your library does not support running under every possible combination of features,
# consider using cargo `hack --each-feature` or some other combination of arguments as described at https://github.com/taiki-e/cargo-hack
- name: Ensure that the library and all examples compile and have no warnings under every possible combination of features in {{ matrix.cargo_profile }} profile
# some things to explicitly point out:
# * clippy also reports rustc warnings and errors
# * clippy --all-targets causes clippy to run against tests and examples which it doesnt do by default.
run: cargo hack --feature-powerset clippy --all-targets --locked ${{ matrix.cargo_profile }} -- -D warnings
- name: Ensure that tests pass under every possible combination of features in ${{ matrix.cargo_profile }} profile
run: cargo test ${{ matrix.cargo_profile }}
- uses: JasonEtco/create-an-issue@v2
if: ${{ failure() }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NIGHTLY_DEPS_WORKFLOW_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
with:
update_existing: true
filename: .github/NIGHTLY_DEPS_ISSUE_TEMPLATE.md