chore: justfile improvement
This commit is contained in:
parent
eff22fdb34
commit
a9df166740
2 changed files with 11 additions and 32 deletions
34
.github/workflows/ci.yml
vendored
34
.github/workflows/ci.yml
vendored
|
|
@ -14,13 +14,9 @@ jobs:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Rust toolchain
|
- name: Rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
profile: minimal
|
|
||||||
components: rustfmt
|
components: rustfmt
|
||||||
default: true
|
|
||||||
- name: Cargo cache
|
- name: Cargo cache
|
||||||
uses: actions/cache@v3
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
|
|
@ -29,10 +25,7 @@ jobs:
|
||||||
~/.cargo/git
|
~/.cargo/git
|
||||||
key: ${{ runner.os }}-cargo-rust_stable-${{ hashFiles('**/Cargo.toml') }}
|
key: ${{ runner.os }}-cargo-rust_stable-${{ hashFiles('**/Cargo.toml') }}
|
||||||
- name: Format
|
- name: Format
|
||||||
uses: actions-rs/cargo@v1
|
run: cargo fmt -- --check
|
||||||
with:
|
|
||||||
command: fmt
|
|
||||||
args: -- --check
|
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
needs:
|
needs:
|
||||||
|
|
@ -69,18 +62,11 @@ jobs:
|
||||||
- name: System dependencies
|
- name: System dependencies
|
||||||
run: sudo apt-get update; sudo apt-get install -y libxkbcommon-dev libwayland-dev
|
run: sudo apt-get update; sudo apt-get install -y libxkbcommon-dev libwayland-dev
|
||||||
- name: Rust toolchain
|
- name: Rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
default: true
|
|
||||||
- name: Test features
|
- name: Test features
|
||||||
uses: actions-rs/cargo@v1
|
run: cargo test --no-default-features --features "${{ matrix.features }}"
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: full
|
RUST_BACKTRACE: full
|
||||||
with:
|
|
||||||
command: test
|
|
||||||
args: --no-default-features --features "${{ matrix.features }}"
|
|
||||||
|
|
||||||
examples:
|
examples:
|
||||||
needs:
|
needs:
|
||||||
|
|
@ -112,16 +98,8 @@ jobs:
|
||||||
- name: System dependencies
|
- name: System dependencies
|
||||||
run: sudo apt-get update; sudo apt-get install -y libxkbcommon-dev libwayland-dev
|
run: sudo apt-get update; sudo apt-get install -y libxkbcommon-dev libwayland-dev
|
||||||
- name: Rust toolchain
|
- name: Rust toolchain
|
||||||
uses: actions-rs/toolchain@v1
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
default: true
|
|
||||||
- name: Test example
|
- name: Test example
|
||||||
uses: actions-rs/cargo@v1
|
run: cargo check -p "${{ matrix.examples }}"
|
||||||
env:
|
env:
|
||||||
RUST_BACKTRACE: full
|
RUST_BACKTRACE: full
|
||||||
with:
|
|
||||||
command: check
|
|
||||||
args: -p "${{ matrix.examples }}"
|
|
||||||
|
|
||||||
|
|
|
||||||
9
justfile
9
justfile
|
|
@ -1,4 +1,5 @@
|
||||||
examples := 'application cosmic cosmic-design-demo open-dialog'
|
examples := 'applet application config cosmic cosmic-design-demo multi-window open-dialog'
|
||||||
|
clippy_args := '-W clippy::all -W clippy::pedantic'
|
||||||
|
|
||||||
# Check for errors and linter warnings
|
# Check for errors and linter warnings
|
||||||
check *args: (check-wayland args) (check-winit args) (check-examples args)
|
check *args: (check-wayland args) (check-winit args) (check-examples args)
|
||||||
|
|
@ -6,14 +7,14 @@ check *args: (check-wayland args) (check-winit args) (check-examples args)
|
||||||
check-examples *args:
|
check-examples *args:
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
for project in {{examples}}; do
|
for project in {{examples}}; do
|
||||||
cargo check -p ${project} {{args}}
|
cargo clippy -p ${project} {{args}} -- {{clippy_args}}
|
||||||
done
|
done
|
||||||
|
|
||||||
check-wayland *args:
|
check-wayland *args:
|
||||||
cargo clippy --no-deps --features="wayland,tokio" {{args}} -- -W clippy::pedantic
|
cargo clippy --no-deps --features="wayland,tokio" {{args}} -- {{clippy_args}}
|
||||||
|
|
||||||
check-winit *args:
|
check-winit *args:
|
||||||
cargo clippy --no-deps --features="winit,tokio" {{args}} -- -W clippy::pedantic
|
cargo clippy --no-deps --features="winit,tokio" {{args}} -- {{clippy_args}}
|
||||||
|
|
||||||
# Runs a check with JSON message format for IDE integration
|
# Runs a check with JSON message format for IDE integration
|
||||||
check-json: (check '--message-format=json')
|
check-json: (check '--message-format=json')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue