ci(canaries): add alerting to provisioned k8s clusters #1622
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
| permissions: | |
| contents: read | |
| on: | |
| pull_request: | |
| merge_group: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| env: | |
| # Allows to fetch multiple private repo crates with different deploy keys. | |
| CARGO_NET_GIT_FETCH_WITH_CLI: true | |
| name: checks | |
| jobs: | |
| codespell: | |
| name: codespell | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Codespell test | |
| uses: codespell-project/actions-codespell@94259cd8be02ad2903ba34a22d9c13de21a74461 | |
| fmt: | |
| runs-on: ubuntu-latest | |
| name: stable / fmt | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Give GitHub Actions access to private crates | |
| uses: webfactory/ssh-agent@v0.8.0 | |
| with: | |
| ssh-private-key: | | |
| ${{ secrets.CAOS_OAUTH_DEPLOY_KEY }} | |
| ${{ secrets.CAOS_OPAMP_DEPLOY_KEY }} | |
| - name: Obtain Rust version from project | |
| run: | | |
| RUST_VERSION=$(grep "rust-version" Cargo.toml | cut -d "=" -f2 | tr -d "[:space:]") | |
| echo "RUST_VERSION=${RUST_VERSION}" >> $GITHUB_ENV | |
| - name: Install Rust ${{ env.RUST_VERSION }} | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| components: rustfmt | |
| toolchain: ${{ env.RUST_VERSION }} | |
| - name: Check code formatting | |
| run: cargo fmt --check | |
| clippy: | |
| runs-on: ubuntu-latest | |
| name: ${{ matrix.flag }} / clippy | |
| permissions: | |
| contents: read | |
| checks: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # newrelic_agent_control needs either onhost or k8s feature, the rest of packages can be checked also without features | |
| flag: [ "--features=onhost", "--features=k8s", "--exclude='newrelic_agent_control'" ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Give GitHub Actions access to private crates | |
| uses: webfactory/ssh-agent@v0.8.0 | |
| with: | |
| ssh-private-key: | | |
| ${{ secrets.CAOS_OAUTH_DEPLOY_KEY }} | |
| ${{ secrets.CAOS_OPAMP_DEPLOY_KEY }} | |
| - name: Obtain Rust version from project | |
| run: | | |
| RUST_VERSION=$(grep "rust-version" Cargo.toml | cut -d "=" -f2 | tr -d "[:space:]") | |
| echo "RUST_VERSION=${RUST_VERSION}" >> $GITHUB_ENV | |
| - name: Install Rust ${{ env.RUST_VERSION }} | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.RUST_VERSION }} | |
| components: clippy | |
| - name: cargo clippy (${{ matrix.flag }}) | |
| run: cargo clippy --workspace ${{ matrix.flag }} --tests -- -D clippy::all | |
| doc: | |
| runs-on: ubuntu-latest | |
| name: stable / doc | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Give GitHub Actions access to private crates | |
| uses: webfactory/ssh-agent@v0.8.0 | |
| with: | |
| ssh-private-key: | | |
| ${{ secrets.CAOS_OAUTH_DEPLOY_KEY }} | |
| ${{ secrets.CAOS_OPAMP_DEPLOY_KEY }} | |
| - name: Obtain Rust version from project | |
| run: | | |
| RUST_VERSION=$(grep "rust-version" Cargo.toml | cut -d "=" -f2 | tr -d "[:space:]") | |
| echo "RUST_VERSION=${RUST_VERSION}" >> $GITHUB_ENV | |
| - name: Install Rust ${{ env.RUST_VERSION }} | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.RUST_VERSION }} | |
| - name: Create on-host documentation | |
| run: cargo doc --no-deps --features=onhost --package newrelic_agent_control | |
| env: | |
| RUSTDOCFLAGS: --cfg docsrs | |
| - name: Create K8s documentation | |
| run: cargo doc --no-deps --features=k8s --package newrelic_agent_control | |
| env: | |
| RUSTDOCFLAGS: --cfg docsrs | |
| licenses: | |
| name: Validate third party libraries | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Give GitHub Actions access to private crates | |
| uses: webfactory/ssh-agent@v0.8.0 | |
| with: | |
| ssh-private-key: | | |
| ${{ secrets.CAOS_OAUTH_DEPLOY_KEY }} | |
| ${{ secrets.CAOS_OPAMP_DEPLOY_KEY }} | |
| - name: Obtain Rust version from project | |
| run: | | |
| RUST_VERSION=$(grep "rust-version" Cargo.toml | cut -d "=" -f2 | tr -d "[:space:]") | |
| echo "RUST_VERSION=${RUST_VERSION}" >> $GITHUB_ENV | |
| - name: Install Rust ${{ env.RUST_VERSION }} | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ env.RUST_VERSION }} | |
| - name: Check security and licensing | |
| run: cargo install --locked cargo-deny && cargo deny check | |
| - name: Ensure that third party notices is up to date | |
| run: make -C license third-party-notices-check |