Merge pull request #763 from arlyon/openapi-1760056354 #1373
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: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - next | |
| pull_request: | |
| branches: | |
| - master | |
| - next | |
| env: | |
| RUSTFLAGS: -Dwarnings | |
| rust_min: 1.88 | |
| jobs: | |
| format: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v5 | |
| - name: Install toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rustfmt | |
| - name: Check formatting for workspace | |
| run: cargo fmt --all -- --check | |
| verify-codegen-crate: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: openapi | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v5 | |
| - name: Install nightly toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| components: rustfmt | |
| - name: Check formatting | |
| run: cargo +nightly fmt -- --check | |
| - name: Install toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.rust_min }} | |
| components: clippy | |
| - name: Run clippy | |
| run: cargo clippy | |
| - name: Run codegen | |
| run: cargo run --release -- --fetch current | |
| - name: Ensure generated files unchanged | |
| uses: tj-actions/verify-changed-files@v20 | |
| id: verify-changed-files | |
| with: | |
| files: | | |
| **/*.rs | |
| - name: Report changed files | |
| if: steps.verify-changed-files.outputs.files_changed == 'true' | |
| env: | |
| CHANGED_FILES: ${{ steps.verify-changed-files.outputs.changed_files }} | |
| run: | | |
| echo "Some files changed after code generation: $CHANGED_FILES" | |
| exit 1 | |
| clippy: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| features: | |
| [ | |
| default-tls, | |
| rustls-tls-webpki-roots, | |
| rustls-tls-native, | |
| async-std-surf, | |
| ] | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v5 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.rust_min }} | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run clippy | |
| run: cargo clippy --no-default-features --features "full serialize deserialize ${{ matrix.features }}" | |
| test-clients: | |
| name: Test Clients | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| features: | |
| [ | |
| default-tls, | |
| rustls-tls-webpki-roots, | |
| rustls-tls-native, | |
| async-std-surf, | |
| ] | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v5 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.rust_min }} | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run tests | |
| run: cargo test --no-default-features --features "full serialize deserialize ${{ matrix.features }}" | |
| stripe-mock-tests: | |
| name: Stripe Mock Tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| features: [default-tls, rustls-tls-webpki-roots, rustls-tls-native] | |
| services: | |
| stripe-mock: | |
| image: stripe/stripe-mock:v0.197.0 | |
| ports: | |
| - 12111:12111 | |
| - 12112:12112 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.rust_min }} | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run stripe mock tests | |
| run: cargo test -p async-stripe-tests --no-default-features --features ${{ matrix.features }} | |
| # Examples tested separately so that we can use crates which don't match our MSRV | |
| examples: | |
| name: Check Examples | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.rust_min }} | |
| components: clippy | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Check examples | |
| run: cargo clippy --workspace |