Skip to content

Commit

Permalink
chore: use toml for nightly toolchain (#82)
Browse files Browse the repository at this point in the history
  • Loading branch information
rinde authored Oct 9, 2024
1 parent 4920db5 commit b21fe24
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
with:
tool: just
- run: |
echo "RUST_TOOLCHAIN=$(sed -nr 's/channel = "(.*)"/\1/p' ./rust-toolchain.toml)" >> $GITHUB_ENV
echo "RUST_TOOLCHAIN=$(just rust-version)" >> $GITHUB_ENV
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
Expand All @@ -28,8 +28,8 @@ jobs:
with:
tool: just
- run: |
echo "RUST_TOOLCHAIN=$(sed -nr 's/channel = "(.*)"/\1/p' ./rust-toolchain.toml)" >> $GITHUB_ENV
echo "RUST_TOOLCHAIN_NIGHTLY=$(cat ./rust-toolchain-nightly)" >> $GITHUB_ENV
echo "RUST_TOOLCHAIN=$(just rust-version)" >> $GITHUB_ENV
echo "RUST_TOOLCHAIN_NIGHTLY=$(just rust-nightly-version)" >> $GITHUB_ENV
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN_NIGHTLY }}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: taiki-e/install-action@v2
with:
tool: just
- run: |
echo "RUST_TOOLCHAIN=$(sed -nr 's/channel = "(.*)"/\1/p' ./rust-toolchain.toml)" >> $GITHUB_ENV
echo "RUST_TOOLCHAIN=$(just rust-version)" >> $GITHUB_ENV
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
Expand Down
9 changes: 8 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
set quiet

rust_nightly_version := `cat rust-toolchain-nightly`
rust_version := `sed -nr 's/channel = "(.*)"/\1/p' rust-toolchain.toml`
rust_nightly_version := `sed -nr 's/channel = "(.*)"/\1/p' rust-toolchain-nightly.toml`

@default: fmt lint test

rust-version:
echo '{{rust_version}}'

rust-nightly-version:
echo '{{rust_nightly_version}}'

fmt:
cargo '+{{rust_nightly_version}}' fmt --all

Expand Down
1 change: 0 additions & 1 deletion rust-toolchain-nightly

This file was deleted.

2 changes: 2 additions & 0 deletions rust-toolchain-nightly.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "nightly-2024-09-06"

0 comments on commit b21fe24

Please sign in to comment.