|
@@ -45,7 +45,21 @@ jobs:
|
|
run: |
|
|
run: |
|
|
echo MELI_MSRV=$(grep -m1 rust-version meli/Cargo.toml | head -n1 | cut -d'"' -f 2 | head -n1) >> $GITHUB_ENV
|
|
echo MELI_MSRV=$(grep -m1 rust-version meli/Cargo.toml | head -n1 | cut -d'"' -f 2 | head -n1) >> $GITHUB_ENV
|
|
printf "Rust MSRV is %s\n" $(grep -m1 rust-version meli/Cargo.toml | head -n1 | cut -d'"' -f 2 | head -n1)
|
|
printf "Rust MSRV is %s\n" $(grep -m1 rust-version meli/Cargo.toml | head -n1 | cut -d'"' -f 2 | head -n1)
|
|
|
|
+ - name: Cache rustup
|
|
|
|
+ id: cache-rustup
|
|
|
|
+ uses: actions/cache@v4
|
|
|
|
+ with:
|
|
|
|
+ path: |
|
|
|
|
+ ~/.rustup/
|
|
|
|
+ ~/.cargo/env
|
|
|
|
+ ~/.cargo/config.toml
|
|
|
|
+ ~/.cargo/bin/
|
|
|
|
+ ~/.cargo/registry/index/
|
|
|
|
+ ~/.cargo/registry/cache/
|
|
|
|
+ ~/.cargo/git/db/
|
|
|
|
+ key: lints-workflow-${{ matrix.build }}-rustup
|
|
- id: rustup-setup
|
|
- id: rustup-setup
|
|
|
|
+ if: steps.cache-rustup.outputs.cache-hit != 'true'
|
|
name: Install Rustup and toolchains
|
|
name: Install Rustup and toolchains
|
|
shell: bash
|
|
shell: bash
|
|
run: |
|
|
run: |
|
|
@@ -60,7 +74,14 @@ jobs:
|
|
rustup component add rustfmt --toolchain ${{ matrix.rust }}-${{ matrix.target }}
|
|
rustup component add rustfmt --toolchain ${{ matrix.rust }}-${{ matrix.target }}
|
|
rustup default ${{ matrix.rust }}
|
|
rustup default ${{ matrix.rust }}
|
|
fi
|
|
fi
|
|
|
|
+ - name: Source .cargo/env
|
|
|
|
+ shell: bash
|
|
|
|
+ run: |
|
|
|
|
+ source "${HOME}/.cargo/env"
|
|
|
|
+ echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
|
|
|
|
+ echo "CARGO_HOME=${CARGO_HOME:-$HOME/.cargo}" >> $GITHUB_ENV
|
|
- name: Setup Rust target
|
|
- name: Setup Rust target
|
|
|
|
+ if: steps.cache-rustup.outputs.cache-hit != 'true'
|
|
run: |
|
|
run: |
|
|
mkdir -p "${{ env.CARGO_HOME }}"
|
|
mkdir -p "${{ env.CARGO_HOME }}"
|
|
cat << EOF > "${{ env.CARGO_HOME }}"/config.toml
|
|
cat << EOF > "${{ env.CARGO_HOME }}"/config.toml
|
|
@@ -68,11 +89,30 @@ jobs:
|
|
target = "${{ matrix.target }}"
|
|
target = "${{ matrix.target }}"
|
|
EOF
|
|
EOF
|
|
- name: Add lint dependencies
|
|
- name: Add lint dependencies
|
|
|
|
+ if: steps.cache-rustup.outputs.cache-hit != 'true'
|
|
shell: bash
|
|
shell: bash
|
|
run: |
|
|
run: |
|
|
cargo install --version 0.15.1 --target "${{ matrix.target }}" cargo-msrv
|
|
cargo install --version 0.15.1 --target "${{ matrix.target }}" cargo-msrv
|
|
# "This package is currently implemented using rust-analyzer internals, so cannot be published on crates.io."
|
|
# "This package is currently implemented using rust-analyzer internals, so cannot be published on crates.io."
|
|
RUSTFLAGS="" cargo install --locked --target "${{ matrix.target }}" --git https://github.com/dcchut/cargo-derivefmt --rev 95da8eee343de4adb25850893873b979258aed7f --bin cargo-derivefmt
|
|
RUSTFLAGS="" cargo install --locked --target "${{ matrix.target }}" --git https://github.com/dcchut/cargo-derivefmt --rev 95da8eee343de4adb25850893873b979258aed7f --bin cargo-derivefmt
|
|
|
|
+ - name: Restore build artifacts cache in target dir
|
|
|
|
+ id: cache-deps
|
|
|
|
+ uses: actions/cache/restore@v4
|
|
|
|
+ with:
|
|
|
|
+ path: target/
|
|
|
|
+ key: workflow-${{ matrix.build }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
|
|
+ - name: clippy
|
|
|
|
+ if: success() || failure()
|
|
|
|
+ run: |
|
|
|
|
+ source "${HOME}/.cargo/env"
|
|
|
|
+ make -f .gitea/Makefile.lint clippy
|
|
|
|
+ - if: steps.cache-deps.outputs.cache-hit != 'true'
|
|
|
|
+ name: Save build artifacts in target dir
|
|
|
|
+ id: save-cache-deps
|
|
|
|
+ uses: actions/cache/save@v4
|
|
|
|
+ with:
|
|
|
|
+ path: target/
|
|
|
|
+ key: workflow-${{ matrix.build }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
- name: cargo-msrv verify melib MSRV
|
|
- name: cargo-msrv verify melib MSRV
|
|
if: success() || failure()
|
|
if: success() || failure()
|
|
run: |
|
|
run: |
|
|
@@ -83,11 +123,6 @@ jobs:
|
|
run: |
|
|
run: |
|
|
source "${HOME}/.cargo/env"
|
|
source "${HOME}/.cargo/env"
|
|
make -f .gitea/Makefile.lint rustfmt
|
|
make -f .gitea/Makefile.lint rustfmt
|
|
- - name: clippy
|
|
|
|
- if: success() || failure()
|
|
|
|
- run: |
|
|
|
|
- source "${HOME}/.cargo/env"
|
|
|
|
- make -f .gitea/Makefile.lint clippy
|
|
|
|
- name: cargo-derivefmt melib
|
|
- name: cargo-derivefmt melib
|
|
if: success() || failure()
|
|
if: success() || failure()
|
|
run: |
|
|
run: |
|