|
| 1 | +name: 🍯 E2E pointing to staging |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + |
| 6 | +permissions: |
| 7 | + contents: read |
| 8 | + packages: write |
| 9 | + |
| 10 | +# NOTE: The below environment vars are bumped automatically by Renovate so we always use the latest |
| 11 | +# versions of the packages in our E2E tests. If you change the names or move these values outside |
| 12 | +# the GitHub workflows please update `renovate.json` accordingly to avoid breaking the automation! |
| 13 | +env: |
| 14 | + HOST_E2E_INFRA_AGENT_VERSION: "1.72.4" |
| 15 | + HOST_E2E_NRDOT_VERSION: "1.8.0" |
| 16 | + |
| 17 | +jobs: |
| 18 | + build-packages: |
| 19 | + name: Build packages |
| 20 | + uses: ./.github/workflows/component_packages.yml |
| 21 | + with: |
| 22 | + pre-release: false |
| 23 | + skip_sign: true |
| 24 | + # tag for staging |
| 25 | + tag_name: 0.600.${{ github.run_id }} |
| 26 | + |
| 27 | + |
| 28 | + on-host-linux-e2e: |
| 29 | + name: OnHost Linux E2E tests |
| 30 | + needs: [ build-packages ] |
| 31 | + runs-on: linux-4-core-nr-control |
| 32 | + strategy: |
| 33 | + fail-fast: false |
| 34 | + matrix: |
| 35 | + group: |
| 36 | + - ebpf-agent |
| 37 | + - remote-config |
| 38 | + - infra-agent |
| 39 | + - nrdot-agent |
| 40 | + - proxy |
| 41 | + steps: |
| 42 | + - name: Record job start time |
| 43 | + run: echo "JOB_START_TIME=$(date +%s)" >> "$GITHUB_ENV" |
| 44 | + |
| 45 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 46 | + - uses: ./.github/actions/install-rust-toolchain |
| 47 | + - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8 |
| 48 | + with: |
| 49 | + name: built-binaries-0.600.${{ github.run_id }} |
| 50 | + path: ./ |
| 51 | + - name: Build e2e-runner binary |
| 52 | + run: cargo build -p e2e-runner |
| 53 | + - name: "Linux e2e ${{ matrix.group }}" |
| 54 | + run: | |
| 55 | + echo "${{ secrets.AC_FC_STAG_E2E_NR_SYSTEM_IDENTITY_PRIVATE_KEY }}" > /tmp/newrelic-agent-control-priv.key |
| 56 | + sudo ${{ github.workspace }}/target/debug/e2e-runner --log-level=debug ${{ matrix.group }} \ |
| 57 | + --artifacts-package-dir ./dist \ |
| 58 | + --nr-api-key "${{ secrets.AC_FC_STAG_E2E_API_KEY }}" \ |
| 59 | + --nr-license-key "${{ secrets.AC_FC_STAG_E2E_LICENSE_KEY }}" \ |
| 60 | + --nr-account-id "${{ secrets.AC_FC_STAG_E2E_ACCOUNT_ID }}" \ |
| 61 | + --nr-region "staging" \ |
| 62 | + --system-identity-client-id "${{ secrets.AC_FC_STAG_E2E_NR_SYSTEM_IDENTITY_CLIENT_ID }}" \ |
| 63 | + --agent-control-private-key "/tmp/newrelic-agent-control-priv.key" \ |
| 64 | + --agent-control-version "0.600.${{ github.run_id }}" \ |
| 65 | + --recipes-repo-branch "main" \ |
| 66 | + --infra-agent-version "${{ env.HOST_E2E_INFRA_AGENT_VERSION }}" \ |
| 67 | + --nrdot-version "${{ env.HOST_E2E_NRDOT_VERSION }}" |
| 68 | +
|
| 69 | + - name: Report test result to New Relic |
| 70 | + if: always() |
| 71 | + env: |
| 72 | + NR_LICENSE_KEY: ${{ secrets.AC_FC_STAG_E2E_LICENSE_KEY }} |
| 73 | + NR_ACCOUNT_ID: ${{ secrets.AC_FC_STAG_E2E_ACCOUNT_ID }} |
| 74 | + E2E_SCENARIO: ${{ matrix.group }} |
| 75 | + E2E_ENVIRONMENT: linux |
| 76 | + E2E_STATUS: ${{ job.status }} |
| 77 | + E2E_CALLER_WORKFLOW: on_demand_staging_e2e |
| 78 | + run: bash .github/workflows/scripts/report_e2e_result.sh |
| 79 | + |
| 80 | + - name: Upload e2e result summary |
| 81 | + if: always() |
| 82 | + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 |
| 83 | + with: |
| 84 | + name: e2e-result-linux-${{ matrix.group }} |
| 85 | + path: e2e-result-*-linux-${{ matrix.group }}.txt |
| 86 | + if-no-files-found: warn |
| 87 | + |
| 88 | + k8s-e2e-tests: |
| 89 | + name: K8s e2e tests ${{ matrix.group }} |
| 90 | + runs-on: linux-4-core-nr-control |
| 91 | + strategy: |
| 92 | + fail-fast: false |
| 93 | + matrix: |
| 94 | + group: |
| 95 | + # apm operator doesn't allow pointing to staging |
| 96 | + - collector |
| 97 | + - fleet-control |
| 98 | + - ebpf |
| 99 | + - dynamic |
| 100 | + - custom-repo |
| 101 | + # proxy has issues pointing to staging |
| 102 | + steps: |
| 103 | + - name: Record job start time |
| 104 | + run: echo "JOB_START_TIME=$(date +%s)" >> "$GITHUB_ENV" |
| 105 | + |
| 106 | + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 107 | + |
| 108 | + - name: Free up space |
| 109 | + run: bash .github/workflows/scripts/space_cleanup.sh |
| 110 | + |
| 111 | + - name: Setup Minikube |
| 112 | + uses: manusa/actions-setup-minikube@96202dee4ae1c2f46a62fe197273aaf22b83f42d # v2.16.1 |
| 113 | + with: |
| 114 | + minikube version: v1.35.0 |
| 115 | + kubernetes version: "v1.30.14" |
| 116 | + start args: '--cni=calico' |
| 117 | + driver: docker |
| 118 | + github token: ${{ secrets.GITHUB_TOKEN }} |
| 119 | + |
| 120 | + - name: Install Tilt |
| 121 | + run: | |
| 122 | + curl -fsSL https://raw.githubusercontent.com/tilt-dev/tilt/master/scripts/install.sh | bash |
| 123 | +
|
| 124 | + - uses: ./.github/actions/install-rust-toolchain |
| 125 | + with: |
| 126 | + targets: >- |
| 127 | + x86_64-unknown-linux-musl |
| 128 | +
|
| 129 | + - uses: ./.github/actions/rust-cache |
| 130 | + with: |
| 131 | + identifier: 'test-dev' |
| 132 | + restore-strategy: 'nearest' |
| 133 | + save-cache: false |
| 134 | + |
| 135 | + - name: Install Zig |
| 136 | + uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29 # v2 |
| 137 | + |
| 138 | + - uses: taiki-e/install-action@cbb1dcaa26e1459e2876c39f61c1e22a1258aac5 # v2.68.33 |
| 139 | + with: |
| 140 | + tool: cargo-zigbuild@0.20.1 |
| 141 | + |
| 142 | + - name: Run k8s e2e-test ${{ matrix.group }} |
| 143 | + uses: newrelic/newrelic-integration-e2e-action@c548a33a0c2941a4db4899ded766923eb3178e0e # v1 |
| 144 | + env: |
| 145 | + # SI L2->L2 for AC |
| 146 | + NR_SYSTEM_IDENTITY_CLIENT_ID: ${{ secrets.AC_FC_STAG_E2E_NR_SYSTEM_IDENTITY_CLIENT_ID }} |
| 147 | + NR_SYSTEM_IDENTITY_PRIVATE_KEY: ${{ secrets.AC_FC_STAG_E2E_NR_SYSTEM_IDENTITY_PRIVATE_KEY }} |
| 148 | + USE_LATEST_FLUX: false |
| 149 | + # Tilt configs |
| 150 | + ARCH: amd64 |
| 151 | + with: |
| 152 | + retry_attempts: 40 |
| 153 | + retry_seconds: 15 |
| 154 | + agent_enabled: false |
| 155 | + spec_path: test/k8s-e2e/${{ matrix.group }}/e2e-${{ matrix.group }}.yml |
| 156 | + account_id: ${{ secrets.AC_FC_STAG_E2E_ACCOUNT_ID }} |
| 157 | + api_key: ${{ secrets.AC_FC_STAG_E2E_API_KEY }} |
| 158 | + license_key: ${{ secrets.AC_FC_STAG_E2E_LICENSE_KEY }} |
| 159 | + region: Staging |
| 160 | + |
| 161 | + - name: Report test result to New Relic |
| 162 | + if: always() |
| 163 | + env: |
| 164 | + NR_LICENSE_KEY: ${{ secrets.AC_FC_STAG_E2E_LICENSE_KEY }} |
| 165 | + NR_ACCOUNT_ID: ${{ secrets.AC_FC_STAG_E2E_ACCOUNT_ID }} |
| 166 | + E2E_REGION: staging |
| 167 | + E2E_SCENARIO: ${{ matrix.group }} |
| 168 | + E2E_ENVIRONMENT: k8s |
| 169 | + E2E_STATUS: ${{ job.status }} |
| 170 | + E2E_CALLER_WORKFLOW: on_demand_staging_e2e |
| 171 | + run: bash .github/workflows/scripts/report_e2e_result.sh |
| 172 | + |
| 173 | + - name: Upload e2e result summary |
| 174 | + if: always() |
| 175 | + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7 |
| 176 | + with: |
| 177 | + name: e2e-result-k8s-${{ matrix.group }} |
| 178 | + path: e2e-result-*-k8s-${{ matrix.group }}.txt |
| 179 | + if-no-files-found: warn |
| 180 | + |
| 181 | + k8s-e2e-tests-check: # The job is useful to notify the failure |
| 182 | + name: K8s e2e tests |
| 183 | + if: always() # cannot be skipped even if required steps fail |
| 184 | + runs-on: ubuntu-latest |
| 185 | + needs: [ k8s-e2e-tests ] |
| 186 | + steps: |
| 187 | + - name: Check if needed jobs succeeded |
| 188 | + uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # 05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe |
| 189 | + with: |
| 190 | + jobs: ${{ toJSON(needs) }} |
0 commit comments