CI/CD: Add clippy and update actions

* Add clippy to CI.

* Update .github/workflows/ci.yml

* Update .github/workflows/ci.yml

* Use `cargo check` instead of `cargo build`

* Update CD workflow

---------

Co-authored-by: Henrik Friedrichsen <henrik@affekt.org>
This commit is contained in:
Thomas Frans
2023-02-28 22:49:32 +01:00
committed by GitHub
parent 879d8e8e04
commit 9ca72e391d
3 changed files with 65 additions and 35 deletions

View File

@@ -49,12 +49,9 @@ jobs:
features: '--no-default-features --features rodio_backend,pancurses_backend,share_clipboard,notify'
steps:
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
override: true
target: ${{ matrix.target }}
profile: minimal
- name: Install macOS dependencies
if: matrix.os == 'macos-latest'
run: brew install portaudio pkg-config
@@ -69,19 +66,17 @@ jobs:
run: |
apt update
apt install -y ${{ matrix.dependencies }}
- uses: actions/checkout@v2
- uses: actions/checkout@v3
name: Checkout src
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Running cargo build
uses: actions-rs/cargo@v1
with:
command: build
args: --locked --release --target ${{ matrix.target }} ${{ matrix.features }}
run: cargo build --release --target ${{ matrix.target }} ${{ matrix.features }}
- name: Extract git tag
shell: bash
run: echo "##[set-output name=tag;]$(echo ${GITHUB_REF#refs/tags/})"
@@ -91,11 +86,11 @@ jobs:
run: |
cd target/${{ matrix.target }}/release
case ${{ matrix.target }} in
*-pc-windows-*)
*-pc-windows-*)
7z -y a ncspot-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.zip ncspot.exe
sha256sum ncspot-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.zip > ncspot-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.sha256
;;
*)
*)
tar czvf ncspot-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.tar.gz ncspot
shasum -a 256 ncspot-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.tar.gz > ncspot-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.sha256
;;