diff --git a/.github/cue/rust.cue b/.github/cue/rust.cue index da50a71..800b72a 100644 --- a/.github/cue/rust.cue +++ b/.github/cue/rust.cue @@ -76,19 +76,7 @@ rust: _#useMergeQueue & { _#checkoutCode, _#installRust, _#cacheRust & {with: "shared-key": "stable-${{ matrix.platform }}"}, - _#installTool & {with: tool: "cargo-nextest"}, - { - name: "Compile tests" - run: "cargo test --locked --no-run" - }, - { - name: "Run tests" - run: "cargo nextest run --locked" - }, - { - name: "Run doctests" - run: "cargo test --locked --doc" - }, + for step in _testRust {step}, ] } diff --git a/.github/cue/scheduled.cue b/.github/cue/scheduled.cue new file mode 100644 index 0000000..0f42985 --- /dev/null +++ b/.github/cue/scheduled.cue @@ -0,0 +1,44 @@ +package workflows + +scheduled: { + name: "scheduled" + + on: { + // Run every Monday at 7:45am UTC. + schedule: [{cron: "45 7 * * 1"}] + + // Allow manually running this workflow. + workflow_dispatch: null + } + + concurrency: { + group: "${{ github.workflow }}-${{ github.ref }}" + "cancel-in-progress": true + } + + env: { + CARGO_INCREMENTAL: 0 + CARGO_TERM_COLOR: "always" + RUST_BACKTRACE: 1 + RUSTFLAGS: "-D warnings" + } + + jobs: direct_minimal_versions: { + name: "direct-minimal-versions / stable" + "runs-on": defaultRunner + steps: [ + _#checkoutCode & {with: ref: defaultBranch}, + _#installRust, + _#installRust & {with: toolchain: "nightly"}, + { + name: "Default to stable Rust" + run: "rustup default stable" + }, + { + name: "Resolve minimal dependency versions instead of maximum" + run: "cargo +nightly update -Zdirect-minimal-versions" + }, + for step in _testRust {step}, + ] + } +} diff --git a/.github/cue/shared-steps.cue b/.github/cue/shared-steps.cue index f5acc75..4ca070d 100644 --- a/.github/cue/shared-steps.cue +++ b/.github/cue/shared-steps.cue @@ -86,3 +86,19 @@ _#prettier: _#step & { uses: "creyD/prettier_action@31355f8eef017f8aeba2e0bc09d8502b13dbbad1" with: prettier_version: "2.8.8" } + +_testRust: [ + _#installTool & {with: tool: "cargo-nextest"}, + _#step & { + name: "Compile tests" + run: "cargo test --locked --no-run" + }, + _#step & { + name: "Run tests" + run: "cargo nextest run --locked --all-targets --all-features" + }, + _#step & { + name: "Run doctests" + run: "cargo test --locked --doc" + }, +] diff --git a/.github/cue/workflows.cue b/.github/cue/workflows.cue index aef98f3..533d43b 100644 --- a/.github/cue/workflows.cue +++ b/.github/cue/workflows.cue @@ -14,6 +14,7 @@ workflows: [ {workflow: githubPages}, {workflow: preloadCaches}, {workflow: rust}, + {workflow: scheduled}, {workflow: wordsmith}, ] diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cdfabcf..75fb55d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -144,7 +144,7 @@ jobs: - name: Compile tests run: cargo test --locked --no-run - name: Run tests - run: cargo nextest run --locked + run: cargo nextest run --locked --all-targets --all-features - name: Run doctests run: cargo test --locked --doc check_msrv: diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml new file mode 100644 index 0000000..3d98b90 --- /dev/null +++ b/.github/workflows/scheduled.yml @@ -0,0 +1,46 @@ +# This file is generated by .github/cue/ci_tool.cue; DO NOT EDIT! + +name: scheduled +"on": + schedule: + - cron: 45 7 * * 1 + workflow_dispatch: null +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +env: + CARGO_INCREMENTAL: 0 + CARGO_TERM_COLOR: always + RUST_BACKTRACE: 1 + RUSTFLAGS: -D warnings +jobs: + direct_minimal_versions: + name: direct-minimal-versions / stable + runs-on: ubuntu-latest + steps: + - name: Checkout source code + uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab + with: + ref: main + - name: Install stable Rust toolchain + uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d + with: + toolchain: stable + - name: Install nightly Rust toolchain + uses: dtolnay/rust-toolchain@b44cb146d03e8d870c57ab64b80f04586349ca5d + with: + toolchain: nightly + - name: Default to stable Rust + run: rustup default stable + - name: Resolve minimal dependency versions instead of maximum + run: cargo +nightly update -Zdirect-minimal-versions + - name: Install cargo-nextest + uses: taiki-e/install-action@a775aaf2e8ed709f76ee019cb77e39fc50613631 + with: + tool: cargo-nextest + - name: Compile tests + run: cargo test --locked --no-run + - name: Run tests + run: cargo nextest run --locked --all-targets --all-features + - name: Run doctests + run: cargo test --locked --doc