[SVLS-8002] fix: collect CPU metric offsets on PlatformStart (#930) #2854
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: Bottlecap (Rust) | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| env: | |
| PB_VERSION: 25.3 | |
| PB_URL: https://github.com/protocolbuffers/protobuf/releases/download | |
| PB_TARGET: linux-x86_64 | |
| jobs: | |
| cancel-previous: | |
| name: Cancel Previous Jobs | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 3 | |
| steps: | |
| - uses: styfle/cancel-workflow-action@0.12.1 | |
| with: | |
| access_token: ${{ secrets.GITHUB_TOKEN }} | |
| all_but_latest: true # can cancel workflows scheduled later | |
| check: | |
| name: Check | |
| runs-on: ubuntu-22.04 | |
| env: | |
| CARGO_INCREMENTAL: "0" | |
| SCCACHE_GHA_ENABLED: "true" | |
| RUSTC_WRAPPER: "sccache" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| # Install protobuf compiler for linux. The versions bundled with Ubuntu | |
| # 20.04 and 22.04 are too old -- our messages require protobuf >= 3.15 -- | |
| # so we need to download a protoc binary instead. | |
| - run: sudo apt-get update | |
| - run: sudo apt-get install -y curl unzip cmake | |
| - name: Install protobuf ${{ env.PB_VERSION }} compiler from binary for ${{ env.PB_TARGET }} | |
| run: | | |
| curl -LO "${{ env.PB_URL }}/v${{ env.PB_VERSION }}/protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" | |
| unzip "protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" -d "$HOME/.local" | |
| export PATH="$PATH:$HOME/.local/bin" | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1.15.2 | |
| with: | |
| cache: false | |
| - uses: mozilla-actions/sccache-action@v0.0.9 | |
| - working-directory: bottlecap | |
| run: cargo check --workspace | |
| clippy: | |
| name: Clippy | |
| runs-on: ubuntu-22.04 | |
| env: | |
| CARGO_INCREMENTAL: "0" | |
| SCCACHE_GHA_ENABLED: "true" | |
| RUSTC_WRAPPER: "sccache" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| # Install protobuf compiler for linux. The versions bundled with Ubuntu | |
| # 20.04 and 22.04 are too old -- our messages require protobuf >= 3.15 -- | |
| # so we need to download a protoc binary instead. | |
| - run: sudo apt-get update | |
| - run: sudo apt-get install -y curl unzip cmake | |
| - name: Install protobuf ${{ env.PB_VERSION }} compiler from binary for ${{ env.PB_TARGET }} | |
| run: | | |
| curl -LO "${{ env.PB_URL }}/v${{ env.PB_VERSION }}/protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" | |
| unzip "protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" -d "$HOME/.local" | |
| export PATH="$PATH:$HOME/.local/bin" | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1.15.2 | |
| with: | |
| components: clippy | |
| cache: false | |
| - uses: mozilla-actions/sccache-action@v0.0.9 | |
| # We need to do these separately because the fips feature is incompatible with the default feature. | |
| - working-directory: bottlecap | |
| run: cargo clippy --workspace --all-targets --features default | |
| - working-directory: bottlecap | |
| run: cargo clippy --workspace --all-targets --no-default-features --features fips | |
| build-all: | |
| name: Build All | |
| runs-on: ubuntu-22.04 | |
| env: | |
| CARGO_INCREMENTAL: "0" | |
| SCCACHE_GHA_ENABLED: "true" | |
| RUSTC_WRAPPER: "sccache" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| # Install protobuf compiler for linux. The versions bundled with Ubuntu | |
| # 20.04 and 22.04 are too old -- our messages require protobuf >= 3.15 -- | |
| # so we need to download a protoc binary instead. | |
| - run: sudo apt-get update | |
| - run: sudo apt-get install -y curl unzip cmake | |
| - name: Install protobuf ${{ env.PB_VERSION }} compiler from binary for ${{ env.PB_TARGET }} | |
| run: | | |
| curl -LO "${{ env.PB_URL }}/v${{ env.PB_VERSION }}/protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" | |
| unzip "protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" -d "$HOME/.local" | |
| export PATH="$PATH:$HOME/.local/bin" | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1.15.2 | |
| with: | |
| cache: false | |
| - uses: mozilla-actions/sccache-action@v0.0.9 | |
| - working-directory: bottlecap | |
| run: cargo build --all | |
| test: | |
| name: Test Suite | |
| runs-on: ubuntu-22.04 | |
| env: | |
| CARGO_INCREMENTAL: "0" | |
| SCCACHE_GHA_ENABLED: "true" | |
| RUSTC_WRAPPER: "sccache" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| # Install protobuf compiler for linux. The versions bundled with Ubuntu | |
| # 20.04 and 22.04 are too old -- our messages require protobuf >= 3.15 -- | |
| # so we need to download a protoc binary instead. | |
| - run: sudo apt-get update | |
| - run: sudo apt-get install -y curl unzip cmake | |
| - name: Install protobuf ${{ env.PB_VERSION }} compiler from binary for ${{ env.PB_TARGET }} | |
| run: | | |
| curl -LO "${{ env.PB_URL }}/v${{ env.PB_VERSION }}/protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" | |
| unzip "protoc-${{ env.PB_VERSION }}-${{ env.PB_TARGET }}.zip" -d "$HOME/.local" | |
| export PATH="$PATH:$HOME/.local/bin" | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1.15.2 | |
| with: | |
| cache: false | |
| - uses: taiki-e/install-action@v2 | |
| with: | |
| tool: nextest@0.9 | |
| - uses: mozilla-actions/sccache-action@v0.0.9 | |
| - working-directory: bottlecap | |
| run: cargo nextest run --workspace | |
| format: | |
| name: Format | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-22.04, macos-latest] | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions-rust-lang/setup-rust-toolchain@v1.15.2 | |
| with: | |
| components: rustfmt | |
| cache: false | |
| - working-directory: bottlecap | |
| run: cargo fmt --all -- --check | |
| # If this fails, run `dd-rust-license-tool write` in bottlecap/ | |
| license-3rdparty: | |
| runs-on: ubuntu-22.04 | |
| name: "Valid LICENSE-3rdparty.csv" | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v5 | |
| - run: cargo install dd-rust-license-tool --locked | |
| - run: dd-rust-license-tool check | |
| working-directory: bottlecap |