feat(remoteUpdate): config #3924
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: | |
| # TODO: validate when to trigger the pipeline | |
| push: | |
| merge_group: | |
| # See https://docs.github.com/en/actions/using-jobs/using-concurrency | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| name: test | |
| jobs: | |
| release-build: | |
| runs-on: ubuntu-latest | |
| name: "Build release binaries" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - 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: cargo generate-lockfile | |
| if: hashFiles('Cargo.lock') == '' | |
| run: cargo generate-lockfile | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-release | |
| - name: Build k8s in release mode | |
| run: cargo build --release --package newrelic_agent_control --bin newrelic-agent-control-k8s | |
| - name: Build onhost in release mode | |
| run: cargo build --release --package newrelic_agent_control --bin newrelic-agent-control-onhost | |
| required: | |
| runs-on: ubuntu-latest | |
| name: ubuntu / ${{ matrix.toolchain }} | |
| strategy: | |
| matrix: | |
| toolchain: [ stable, beta ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - 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 ${{ matrix.toolchain }} | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.toolchain }} | |
| - name: cargo generate-lockfile | |
| if: hashFiles('Cargo.lock') == '' | |
| run: cargo generate-lockfile | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-debug | |
| - name: Run workspace tests excluding the agent control package | |
| run: cargo test --workspace --exclude 'newrelic_agent_control' --all-targets | |
| - name: Run tests agent control lib excluding root-required tests (on-host) | |
| run: make -C agent-control test/onhost | |
| - name: Run tests agent control integration_test excluding root-required tests (on-host) | |
| run: make -C agent-control test/onhost/integration | |
| - name: Run tests agent control (k8s) | |
| run: make -C agent-control test/k8s | |
| - name: Run documentation tests | |
| run: cargo test --locked --doc | |
| # Test using root can be troublesome to perform as usually the Rust toolchain is installed local to the user. | |
| # To test for root privileges, we can run from a container (disabling the test that fail if running non-root). | |
| test-with-root: | |
| runs-on: ubuntu-latest | |
| container: rust:latest | |
| name: tests as root | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - 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 }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-debug | |
| - name: Run onHost root-required lib tests only | |
| run: make -C agent-control test/onhost/root | |
| - name: Run onHost root-required integration-tests only | |
| run: make -C agent-control test/onhost/root/integration | |
| embedded: | |
| name: Unit test for embedded downloader | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: "build/embedded/go.mod" | |
| - name: run tests for embedded downloader | |
| run: make -C build/embedded test | |
| k8s-integration-tests: | |
| name: K8s integration tests | |
| # minikube action requires ubuntu-22.04 at the moment | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup Minikube | |
| uses: manusa/actions-setup-minikube@v2.10.0 | |
| with: | |
| minikube version: v1.32.0 | |
| kubernetes version: "v1.30.9" # Should we support a specific range of versions? | |
| driver: docker | |
| - name: Install Tilt | |
| run: | | |
| curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | bash | |
| - 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 }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-debug | |
| - name: Run k8s integration tests | |
| run: make -C agent-control test/k8s/integration | |
| # These tests are using (by default) the released charts | |
| # In case a breaking change is introduced by the PR, a feature branch can be used as explained | |
| # in the test/k8s-e2e/Readme.md | |
| k8s-e2e-tests: | |
| name: K8s e2e tests ${{ matrix.group }} | |
| # minikube action requires ubuntu-22.04 at the moment | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| group: [ collector, apm, infra ] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Setup Minikube | |
| uses: manusa/actions-setup-minikube@v2.10.0 | |
| with: | |
| minikube version: v1.32.0 | |
| kubernetes version: "v1.30.9" | |
| driver: docker | |
| - name: Install Tilt | |
| run: | | |
| curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | bash | |
| - 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 }} | |
| - uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/bin/ | |
| ~/.cargo/registry/index/ | |
| ~/.cargo/registry/cache/ | |
| ~/.cargo/git/db/ | |
| target/ | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}-debug | |
| - name: Run k8s e2e-test ${{ matrix.group }} | |
| uses: newrelic/newrelic-integration-e2e-action@v1 | |
| env: | |
| # Tilt configs | |
| ARCH: amd64 | |
| BUILD_WITH: cargo | |
| with: | |
| retry_attempts: 10 | |
| agent_enabled: false | |
| spec_path: test/k8s-e2e/e2e-${{ matrix.group }}.yml | |
| account_id: ${{ secrets.COREINT_E2E_ACCOUNT_ID }} | |
| api_key: ${{ secrets.COREINT_E2E_API_KEY }} | |
| license_key: ${{ secrets.COREINT_E2E_LICENSE_KEY }} | |
| k8s-e2e-tests-check: # The job does nothing, it is used for branch protection | |
| name: K8s e2e tests | |
| if: always() # cannot be skipped even if required steps fail | |
| runs-on: ubuntu-latest | |
| needs: [ k8s-e2e-tests ] | |
| steps: | |
| - name: Check if needed jobs succeeded | |
| uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe | |
| with: | |
| jobs: ${{ toJSON(needs) }} |