Skip to content

allow and ignore #[doc(...)] tags in ToSchema derive (#708) #1717

allow and ignore #[doc(...)] tags in ToSchema derive (#708)

allow and ignore #[doc(...)] tags in ToSchema derive (#708) #1717

Workflow file for this run

name: Utoipa build
on:
push:
paths:
- "**.rs"
- "**Cargo.toml"
pull_request:
branches: [master]
paths:
- "**.rs"
- "**Cargo.toml"
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
matrix:
crate:
- utoipa
- utoipa-gen
- utoipa-swagger-ui
fail-fast: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 2
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Resolve changed paths
id: changes
run: |
changes=false
while read -r change; do
if [[ "$change" == "utoipa-gen" && "${{ matrix.crate }}" == "utoipa-gen" && $changes == false ]]; then
changes=true
elif [[ "$change" == "utoipa-swagger-ui" && "${{ matrix.crate }}" == "utoipa-swagger-ui" && $changes == false ]]; then
changes=true
elif [[ "$change" == "utoipa" && "${{ matrix.crate }}" == "utoipa" && $changes == false ]]; then
changes=true
fi
done < <(git diff --name-only ${{ github.sha }}~ ${{ github.sha }} | grep .rs | awk -F \/ '{print $1}')
echo "${{ matrix.crate }} changes: $changes"
echo "changes=$changes" >> $GITHUB_OUTPUT
- name: Check format
run: |
if [[ ${{ steps.changes.outputs.changes }} == true ]]; then
cargo fmt --check --package ${{ matrix.crate }}
fi
- name: Check clippy
run: |
if [[ ${{ steps.changes.outputs.changes }} == true ]]; then
cargo clippy --quiet --package ${{ matrix.crate }}
fi
- name: Run tests
run: |
if [[ ${{ steps.changes.outputs.changes }} == true ]]; then
./scripts/test.sh ${{ matrix.crate }}
fi