Skip to content

Commit

Permalink
ci: replace actions-rs/toolchain with dtolnay/rust-toolchain
Browse files Browse the repository at this point in the history
Because `actions-rs` [is unmaintained](actions-rs/toolchain#216).

Signed-off-by: Mikhail Grachev <work@mgrachev.com>
  • Loading branch information
mgrachev committed Oct 17, 2022
1 parent d9876ed commit 3fd9c52
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 38 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/benchmark.yml
Expand Up @@ -11,10 +11,7 @@ jobs:
if: ${{ github.event.label.name == 'benchmark' }}
runs-on: ubuntu-latest
steps:
- uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: stable
- uses: dtolnay/rust-toolchain@stable
- uses: actions/checkout@v3
with:
fetch-depth: 0
Expand Down
29 changes: 8 additions & 21 deletions .github/workflows/ci.yml
Expand Up @@ -16,11 +16,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2.0.1
- run: cargo check --all-targets
- run: cargo fmt --all --check
Expand All @@ -30,11 +26,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: nightly
override: true
- uses: dtolnay/rust-toolchain@nightly
# https://github.com/dtolnay/rust-toolchain/issues/29
- run: rustup override set nightly
- name: Set grcov version
run: echo "GRCOV_VERSION=$(cargo search --limit 1 grcov | head -n1 | cut -d '"' -f2)" >> $GITHUB_ENV
- uses: Swatinem/rust-cache@v2.0.1
Expand All @@ -59,10 +53,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: stable
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2.0.1
- run: cargo install cargo-sort
- run: cargo-sort --check
Expand All @@ -87,10 +78,7 @@ jobs:
- name: Disable EOL conversion
run: git config --global core.autocrlf false
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1.0.7
with:
profile: minimal
toolchain: stable
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2.0.1
- run: cargo test --all-features --no-fail-fast

Expand Down Expand Up @@ -212,11 +200,10 @@ jobs:
sudo apt-get install -y gcc-aarch64-linux-gnu musl-tools
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- uses: actions-rs/toolchain@v1.0.7
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.TOOLCHAIN }}
target: ${{ matrix.TARGET }}
override: true
targets: ${{ matrix.TARGET }}
- uses: Swatinem/rust-cache@v2.0.1
with:
key: ${{ matrix.TARGET }}
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/release.yml
Expand Up @@ -84,11 +84,10 @@ jobs:
sudo apt-get install -y gcc-aarch64-linux-gnu musl-tools
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- uses: actions-rs/toolchain@v1.0.7
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.TOOLCHAIN }}
target: ${{ matrix.TARGET }}
override: true
targets: ${{ matrix.TARGET }}
- uses: Swatinem/rust-cache@v2.0.1
with:
key: ${{ matrix.TARGET }}
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.60.0"
channel = "stable"
components = ["rustfmt", "clippy"]
2 changes: 1 addition & 1 deletion src/common/comment.rs
Expand Up @@ -5,7 +5,7 @@ const PREFIX: &str = "dotenv-linter";
const ON: &str = "on";
const OFF: &str = "off";

#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Eq)]
pub struct Comment {
disable: bool,
pub checks: Vec<LintKind>,
Expand Down
2 changes: 1 addition & 1 deletion src/common/line_entry.rs
@@ -1,6 +1,6 @@
use super::{comment::Comment, is_escaped};

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct LineEntry {
pub number: usize,
pub raw_string: String,
Expand Down
2 changes: 1 addition & 1 deletion src/common/warning.rs
Expand Up @@ -2,7 +2,7 @@ use super::LintKind;
use colored::*;
use std::fmt;

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Warning {
pub check_name: LintKind,
pub line_number: usize,
Expand Down
9 changes: 3 additions & 6 deletions src/lib.rs
Expand Up @@ -315,12 +315,9 @@ fn find_multiline_ranges(lines: &[LineEntry]) -> Vec<(usize, usize)> {

/// Returns the `QuoteType` for a `&str` starting with a quote-char
fn is_multiline_start(val: &str) -> Option<QuoteType> {
for quote_type in [QuoteType::Single, QuoteType::Double] {
if quote_type.is_quoted_value(val) {
return Some(quote_type);
}
}
None
[QuoteType::Single, QuoteType::Double]
.into_iter()
.find(|quote_type| quote_type.is_quoted_value(val))
}

/// Prints information about the new version to `STDOUT` if a new version is available
Expand Down

0 comments on commit 3fd9c52

Please sign in to comment.