mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-25 10:33:21 +03:00
aa4e1667c7
- unclear why these were ever ignored
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
|
|
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
|