Fixup failing CI in rust-server due to xmltree dependency #648
Workflow file for this run
This file contains hidden or 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: Samples Rust | |
| on: | |
| push: | |
| paths: | |
| - "samples/client/others/rust/**" | |
| - "samples/server/petstore/rust-server/**" | |
| - "samples/client/petstore/rust-server/**" | |
| - "samples/server/petstore/rust-axum/**" | |
| pull_request: | |
| paths: | |
| - "samples/client/others/rust/**" | |
| - "samples/client/petstore/rust/**" | |
| - "samples/server/petstore/rust-server/**" | |
| - "samples/server/petstore/rust-axum/**" | |
| jobs: | |
| build: | |
| name: Build Rust | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| sample: | |
| # these folders contain sub-projects of rust clients, servers | |
| - samples/client/others/rust/ | |
| - samples/client/petstore/rust/ | |
| - samples/server/petstore/rust-server/ | |
| - samples/server/petstore/rust-server-deprecated/ | |
| - samples/server/petstore/rust-axum/ | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| - name: Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-targets: false # Don't cache workspace target directories as they don't exist | |
| cache-directories: | |
| ${{ matrix.sample }}/target | |
| workspaces: | | |
| ${{ matrix.sample }}/output/* | |
| - name: Build | |
| working-directory: ${{ matrix.sample }} | |
| run: cargo build --all-targets --all-features | |
| - name: Tests | |
| working-directory: ${{ matrix.sample }} | |
| run: | | |
| set -e | |
| # Skip samples/client/petstore/rust/ as its tests are failing. | |
| if [[ "${{ matrix.sample }}" == "samples/client/petstore/rust/" ]]; then | |
| echo "Skipping tests for samples/client/petstore/rust/" | |
| exit 0 | |
| fi | |
| # Iterate through each example and test various features | |
| for package in $(find . -maxdepth 1 -mindepth 1 -type d) | |
| do | |
| # Not all versions have a client example | |
| if test -f examples/client/main.rs; then | |
| cargo build --example client --features="client" | |
| fi | |
| # Not all versions have a server example | |
| if test -f examples/server/main.rs; then | |
| cargo build --example server --features="server" | |
| fi | |
| # Test the CLI works if present | |
| if test -f bin/cli.rs; then | |
| cargo build --bin ${package##*/} --features cli | |
| target/debug/${package##*/} --help | |
| fi | |
| cargo fmt | |
| cargo test | |
| cargo clippy | |
| cargo doc | |
| done |