Skip to content

Commit

Permalink
build: use fixed nightly, add scheduled workflow with latest nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
hseeberger committed Oct 22, 2023
1 parent 1e0987f commit f2e9ece
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 12 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ on:
- main
tags-ignore:
- v*

pull_request:
branches:
- main
workflow_dispatch:
schedule:
- cron: 0 6/18 * * *

env:
IS_SCHEDULE: ${{ github.event_name == 'schedule' && 'true' || '' }}

jobs:
ci:
Expand All @@ -18,12 +23,19 @@ jobs:
- name: Check out
uses: actions/checkout@v3

- name: Determine toolchain
run: |
if [ -z $IS_SCHEDULE ]; then
toolchain = grep channel rust-toolchain.toml | sed -r 's/channel = "(.*)"/\1/'
else
toolchain = 'nightly'
fi
echo "setting RUSTUP_TOOLCHAIN to $toolchain"
echo "RUSTUP_TOOLCHAIN=$toolchain" >> "$GITHUB_ENV"
- name: Install Rust toolchain
run: |
rustup update
rustup toolchain install nightly --profile minimal
rustup component add rustfmt --toolchain nightly
rustup component add clippy --toolchain nightly
rustup toolchain install $RUSTUP_TOOLCHAIN
- name: Install just
uses: taiki-e/install-action@v2
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
set shell := ["bash", "-uc"]

check:
@echo "using toolchain $RUSTUP_TOOLCHAIN"
cargo check --tests --all-features

fmt:
cargo +nightly fmt
@echo "using toolchain $RUSTUP_TOOLCHAIN"
cargo fmt

fmt_check:
cargo +nightly fmt --check
@echo "using toolchain $RUSTUP_TOOLCHAIN"
cargo check

lint:
@echo "using toolchain $RUSTUP_TOOLCHAIN"
cargo clippy --no-deps --all-features -- -D warnings

test:
@echo "using toolchain $RUSTUP_TOOLCHAIN"
cargo test --all-features

fix:
@echo "using toolchain $RUSTUP_TOOLCHAIN"
cargo fix --allow-dirty --allow-staged --all-features

doc:
@echo "using toolchain $RUSTUP_TOOLCHAIN"
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features

all: fmt check lint test doc
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly"
channel = "nightly-2023-10-21"

0 comments on commit f2e9ece

Please sign in to comment.