gitbutler/.github/actions/check-crate/action.yaml
Mattias Granlund aa4e1667c7 Enable prettier for .vscode files
- unclear why these were ever ignored
2024-10-09 11:31:08 +02:00

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