mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-18 23:02:31 +03:00
e2ae098aa1
- different dependencies -> different cache
40 lines
1.2 KiB
YAML
40 lines
1.2 KiB
YAML
name: check-crate
|
|
description: tests a core lib crate
|
|
inputs:
|
|
features:
|
|
description: "the features to enable (can be an array, or '*' for all, '' for defaults, or [] for none)"
|
|
required: false
|
|
runs:
|
|
using: 'composite'
|
|
steps:
|
|
- name: Rust Cache
|
|
uses: Swatinem/rust-cache@v2.7.3
|
|
with:
|
|
shared-key: unix-rust-testing-v2
|
|
key: ${{ inputs.features }}
|
|
|
|
- run: |
|
|
printf '%s\n' "$JSON_DOC" > /tmp/features.json
|
|
cat /tmp/features.json | jq -r 'if . == "*" then "--all-features" elif . == "" then "" elif type == "array" then if length == 0 then "--no-default-features" else "--no-default-features --features " + join(",") end else . end' > /tmp/features
|
|
cat /tmp/features
|
|
env:
|
|
FEATURES: ${{ inputs.features }}
|
|
shell: bash
|
|
|
|
- run: |
|
|
cargo test --workspace $(cat /tmp/features)
|
|
env:
|
|
GITBUTLER_TESTS_NO_CLEANUP: '1'
|
|
CARGO_TERM_COLOR: always
|
|
shell: bash
|
|
|
|
- run: cargo clippy --workspace $(cat /tmp/features) -- -D warnings
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
shell: bash
|
|
|
|
- run: cargo clippy --workspace --tests $(cat /tmp/features) -- -D warnings
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
shell: bash
|