feat: Extend 'osc auth' commands #5659
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: CI | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| paths: | |
| - 'Cargo.toml' | |
| - 'Cargo.lock' | |
| - '.github/workflows/ci.yml' | |
| - 'auth-*/**' | |
| - 'cli-*/**' | |
| - 'openstack_cli/**' | |
| - 'openstack_sdk/**' | |
| - 'openstack_tui/**' | |
| - 'openstack_types/**' | |
| - 'sdk/**' | |
| - 'fuzz/**' | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
| cancel-in-progress: true | |
| env: | |
| CARGO_TERM_COLOR: always | |
| NEXTEST_RETRIES: 3 | |
| jobs: | |
| test: | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-latest | |
| test_args: "" | |
| rust_ver: 1.91 | |
| # - target: x86_64-unknown-linux-musl | |
| # os: ubuntu-latest | |
| # - target: x86_64-apple-darwin | |
| # os: macos-latest | |
| # - target: x86_64-pc-windows-msvc | |
| # os: windows-latest | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0 | |
| with: | |
| egress-policy: audit | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libudev-dev | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Cache cargo registry | |
| uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 # stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| toolchain: ${{ matrix.rust_ver }} | |
| - name: Install cargo-nextest | |
| uses: taiki-e/install-action@9e1e5806d4a4822de933115878265be9aaa786d9 # v2.82.2 | |
| with: | |
| tool: cargo-nextest | |
| - name: Run tests | |
| run: cargo nextest run ${{ matrix.test_args }} --all-features | |
| - name: Run Doc tests | |
| run: cargo test --doc | |
| fuzz: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Cache cargo registry | |
| uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 # stable | |
| with: | |
| toolchain: nightly | |
| - name: Install cargo-fuzz | |
| run: | | |
| cargo install cargo-fuzz | |
| - name: Run tests | |
| run: | | |
| for target in fuzz_openstack_sdk_config fuzz_openstack_sdk_config_yaml fuzz_link_header fuzz_next_page_from_body fuzz_expand_link fuzz_discovery_endpoints fuzz_api_version fuzz_api_error_from_openstack fuzz_auth_error_response fuzz_build_request_url fuzz_state_cache fuzz_wasm_plugin_identity_http_request fuzz_wasm_plugin_sso_build_response fuzz_wasm_plugin_auth_result; do | |
| cargo +nightly fuzz run "$target" --features=fuzzing -- -max_total_time=60 | |
| done | |
| mock: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c # v2.21.0 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| - name: Cache cargo registry | |
| uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@6d653acede28d24f02e3cd41383119e8b1b35921 # stable | |
| with: | |
| toolchain: stable | |
| - name: Start prism mock server - BlockStorage | |
| run: | | |
| docker run --init --rm -d -v "$GITHUB_WORKSPACE/openstack_types/data":"/data" -p 4010:4010 stoplight/prism:4 mock -h 0.0.0.0 /data/block-storage/v3.yaml -d | |
| - name: Start prism mock server - Compute | |
| run: | | |
| docker run --init --rm -d -v "$GITHUB_WORKSPACE/openstack_types/data":"/data" -p 4011:4010 stoplight/prism:4 mock -h 0.0.0.0 /data/compute/v2.yaml -d | |
| - name: Start prism mock server - DNS | |
| run: | | |
| docker run --init --rm -d -v "$GITHUB_WORKSPACE/openstack_types/data":"/data" -p 4012:4010 stoplight/prism:4 mock -h 0.0.0.0 /data/dns/v2.yaml -d | |
| - name: Start prism mock server - Identity | |
| run: | | |
| docker run --init --rm -d -v "$GITHUB_WORKSPACE/openstack_types/data":"/data" -p 4013:4010 stoplight/prism:4 mock -h 0.0.0.0 /data/identity/v3.yaml -d | |
| - name: Start prism mock server - Image | |
| run: | | |
| docker run --init --rm -d -v "$GITHUB_WORKSPACE/openstack_types/data":"/data" -p 4014:4010 stoplight/prism:4 mock -h 0.0.0.0 /data/image/v2.yaml -d | |
| - name: Start prism mock server - Load Balancer | |
| run: | | |
| docker run --init --rm -d -v "$GITHUB_WORKSPACE/openstack_types/data":"/data" -p 4015:4010 stoplight/prism:4 mock -h 0.0.0.0 /data/load-balancer/v2.yaml -d | |
| - name: Start prism mock server - Network | |
| run: | | |
| docker run --init --rm -d -v "$GITHUB_WORKSPACE/openstack_types/data":"/data" -p 4016:4010 stoplight/prism:4 mock -h 0.0.0.0 /data/network/v2.yaml -d | |
| - name: Start prism mock server - Object Storage | |
| run: | | |
| docker run --init --rm -d -v "$GITHUB_WORKSPACE/openstack_types/data":"/data" -p 4017:4010 stoplight/prism:4 mock -h 0.0.0.0 /data/object-store/v1.yaml -d | |
| - name: Run tests | |
| env: | |
| OPENSTACK_BLOCK_STORAGE_ENDPOINT: http://localhost:4010/v3 | |
| OPENSTACK_COMPUTE_ENDPOINT: http://localhost:4011/v2.1 | |
| OPENSTACK_DNS_ENDPOINT: http://localhost:4012/v2 | |
| OPENSTACK_IDENTITY_ENDPOINT: http://localhost:4013/v3 | |
| OPENSTACK_IMAGE_ENDPOINT: http://localhost:4014/v2 | |
| OPENSTACK_LOAD_BALANCER_ENDPOINT: http://localhost:4015/v2 | |
| OPENSTACK_NETWORK_ENDPOINT: http://localhost:4016/v2.0 | |
| OPENSTACK_OBJECT_STORE_ENDPOINT: http://localhost:4017/v1 | |
| run: cargo test -p openstack_types --test mocked |