refactor(spire-api): use spiffe 0.8 grpc + non-mut client (#212) #909
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: Build | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| setup-and-lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| submodules: recursive | |
| - name: Install toolchain | |
| uses: ./.github/actions/setup-env | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Cache Project | |
| uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 | |
| with: | |
| shared-key: ${{ runner.os }}-cargo | |
| - name: Rustfmt (check) | |
| run: cargo fmt -- --check | |
| - name: Clippy | |
| run: cargo clippy --workspace --all-targets -- -D warnings | |
| build-and-test: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| needs: setup-and-lint | |
| env: | |
| SPIFFE_ENDPOINT_SOCKET: unix:/tmp/spire-agent/public/api.sock | |
| SPIRE_ADMIN_ENDPOINT_SOCKET: unix:/tmp/spire-agent/admin/api.sock | |
| RUST_BACKTRACE: "1" | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| submodules: recursive | |
| - name: Install toolchain | |
| uses: ./.github/actions/setup-env | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Cache Project | |
| uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 | |
| with: | |
| shared-key: ${{ runner.os }}-cargo | |
| - name: Build workspace (default features) | |
| run: cargo build --workspace --all-targets | |
| - name: Test workspace | |
| run: cargo test --workspace | |
| - name: Build spiffe-rustls (aws-lc-rs) | |
| run: cargo build -p spiffe-rustls --no-default-features --features aws-lc-rs --all-targets | |
| - name: Test spiffe-rustls (aws-lc-rs) | |
| run: cargo test -p spiffe-rustls --no-default-features --features aws-lc-rs | |
| - name: Build spiffe-rustls examples (tcp) | |
| run: cargo build -p spiffe-rustls --features tcp-examples --examples | |
| - name: Start SPIRE | |
| run: .github/workflows/scripts/run-spire.sh | |
| - name: Run Integration Tests | |
| run: | | |
| cargo test --manifest-path spiffe/Cargo.toml --features integration-tests | |
| cargo test --manifest-path spire-api/Cargo.toml --features integration-tests | |
| cargo test --manifest-path spiffe-rustls/Cargo.toml --features integration-tests | |
| - name: Clean up SPIRE | |
| if: ${{ always() }} | |
| run: .github/workflows/scripts/cleanup-spire.sh | |
| msrv: | |
| name: MSRV (Rust 1.83) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| submodules: recursive | |
| - name: Install Rust 1.83.0 | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: 1.83.0 | |
| - name: Cache Project | |
| uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2.8.2 | |
| with: | |
| shared-key: ${{ runner.os }}-cargo-msrv-1.83.0 | |
| - name: Build (MSRV) | |
| run: | | |
| rm -f Cargo.lock | |
| cargo build --manifest-path spiffe/Cargo.toml --all-targets | |
| cargo build --manifest-path spire-api/Cargo.toml --all-targets | |
| cargo build --manifest-path spiffe-rustls/Cargo.toml --all-targets | |
| - name: Test (MSRV) | |
| run: | | |
| cargo test --manifest-path spiffe/Cargo.toml | |
| cargo test --manifest-path spire-api/Cargo.toml | |
| cargo test --manifest-path spiffe-rustls/Cargo.toml |