chore(deps): update dependency typescript to v5.4.5 - autoclosed #1007
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
env: | |
RUSTDOCFLAGS: "--default-theme ayu" | |
RUST_BACKTRACE: "1" | |
# speed up build by using clang/lld | |
CC: "clang-14" | |
CXX: "clang++-14" | |
LD: "clang-14" | |
LDFLAGS: "-fuse-ld=lld-14" | |
RUSTFLAGS: "-C linker=clang-14 -C link-arg=-fuse-ld=lld-14" | |
jobs: | |
webpack: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
- run: cd redoc/src && npm install && npm run webpack | |
- run: git diff --exit-code redoc/src | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
rust: | |
- name: MSRV | |
toolchain: "1.67" | |
nightly: false | |
- name: Stable | |
toolchain: stable | |
nightly: false | |
- name: beta | |
toolchain: beta | |
nightly: false | |
- name: nightly | |
toolchain: nightly | |
nightly: true | |
features: | |
- name: default | |
flags: "" | |
- name: openapi | |
flags: "--no-default-features --features openapi" | |
- name: full | |
flags: "--no-default-features --features full" | |
runs-on: ubuntu-latest | |
name: Test on Rust ${{matrix.rust.name}} with ${{matrix.features.name}} features | |
continue-on-error: ${{matrix.rust.nightly}} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{matrix.rust.toolchain}} | |
id: rust-toolchain | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/git | |
~/.cargo/registry | |
target | |
key: "${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}}" | |
- run: RUSTFLAGS="$RUSTFLAGS --cfg gotham_restful_deny_warnings" cargo test ${{matrix.features.flags}} | |
test-trybuild: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: "1.69" | |
id: rust-toolchain | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/git | |
~/.cargo/registry | |
target | |
key: "${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}} (trybuild)" | |
- run: cargo test --no-default-features --features full --tests -- --ignored | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: "1.69" | |
components: clippy | |
id: rust-toolchain | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/git | |
~/.cargo/registry | |
target | |
key: "${{runner.os}} Rust ${{steps.rust-toolchain.outputs.cachekey}} (clippy)" | |
- run: cargo clippy --workspace --profile test -- -Dclippy::all | |
rustfmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: rustfmt | |
- run: cargo fmt --all -- --check | |
- run: ./tests/ui/rustfmt.sh --check | |
readme: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: docker://ghcr.io/msrd0/cargo-doc2readme | |
with: | |
entrypoint: ./readme.sh | |
args: --check | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
id: rust-toolchain | |
- name: Get Tarpaulin Version | |
id: tarpaulin-version | |
run: echo "version=$(wget -qO- 'https://crates.io/api/v1/crates/cargo-tarpaulin' | jq -r '.crate.max_stable_version')" >>$GITHUB_OUTPUT | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/cargo-tarpaulin | |
~/.cargo/git | |
~/.cargo/registry | |
target | |
key: "${{runner.os}} Rust ${{steps.rust-version.outputs.version}} tarpaulin ${{steps.tarpaulin-version.outputs.version}}" | |
- name: Install Tarpaulin | |
run: | | |
test -e ~/.cargo/bin/cargo-tarpaulin || cargo install cargo-tarpaulin --version ${{steps.tarpaulin-version.outputs.version}} | |
- name: Run Tarpaulin coverage tests | |
run: | | |
cargo tarpaulin -v \ | |
--target-dir target/tarpaulin \ | |
--no-default-features \ | |
--features full \ | |
--exclude-files 'derive/*' \ | |
--exclude-files 'target/*' \ | |
--ignore-panics --ignore-tests \ | |
--out Html --out Json | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: tarpaulin-report | |
path: | | |
tarpaulin-report.json | |
tarpaulin-report.html | |
doc: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo | |
target | |
key: ${{runner.os}}-cargo-doc | |
- run: RUSTDOCFLAGS="$RUSTDOCFLAGS --cfg gotham_restful_deny_warnings" cargo doc --no-default-features --features full --no-deps | |
- run: tar cfJ rustdoc.tar.xz target/doc/ | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: rustdoc | |
path: rustdoc.tar.xz | |
pages: | |
runs-on: ubuntu-latest | |
needs: [coverage, doc] | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
- uses: actions/download-artifact@v3 | |
with: | |
name: rustdoc | |
- uses: actions/download-artifact@v3 | |
with: | |
name: tarpaulin-report | |
- run: | | |
test ! -d ./doc || rm -r ./doc | |
tar xfJ rustdoc.tar.xz --strip-components=1 | |
rm rustdoc.tar.xz | |
date >./doc/.timestamp | |
coverage=$(jq '.files | { covered: map(.covered) | add, coverable: map(.coverable) | add } | .covered / .coverable * 10000 | round | . / 100' tarpaulin-report.json) | |
color=$([[ $coverage < 80 ]] && printf yellow || printf brightgreen) | |
wget -qO coverage.svg "https://img.shields.io/badge/coverage-$coverage%25-$color" | |
git add ./doc coverage.svg || true | |
git status | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "GitHub Pages for ${{github.sha}}" |