From 2bfe94ce4007233808d08c889e74443ec75ceb67 Mon Sep 17 00:00:00 2001 From: Austin Parker Date: Mon, 27 Nov 2023 12:51:09 -0500 Subject: [PATCH 01/11] add CI --- .github/workflows/run-integration-tests.yml | 44 +++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/run-integration-tests.yml diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml new file mode 100644 index 0000000000..f87c0c4383 --- /dev/null +++ b/.github/workflows/run-integration-tests.yml @@ -0,0 +1,44 @@ +name: Integration Tests + +on: + workflow_run: + workflows: ["Checks"] + types: + - completed + +jobs: + build_runner: + runs-on: ubuntu-latest + if: ${{ github.event.workflow_run.conclusion == 'success' }} + steps: + - name: metal-runner-action + uses: equinix-labs/metal-action-runner@v0.1.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + metal_auth_token: ${{ secrets.METAL_AUTH_TOKEN }} + metal_project_id: ${{ secrets.METAL_PROJECT_ID }} + metro: "da" + plan: "c3.small.x86" + os: "ubuntu_20_04" + + run_tests: + needs: build_runner + runs-on: self-hosted + + steps: + - name: check out code + uses: actions/checkout@v3 + - name: run tracetesting + run: | + make run-tracetesting + + destroy: + needs: [build_runner, run_tests] + runs-on: ubuntu-latest + steps: + - name: metal-sweeper-action + uses: equinix-labs/metal-action-sweeper@v0.6.0 + with: + authToken: ${{ secrets.METAL_AUTH_TOKEN }} + projectID: ${{ secrets.METAL_PROJECT_ID }} + keepProject: true \ No newline at end of file From 99e037b56aafa88ef290602209f1ada8d29928fc Mon Sep 17 00:00:00 2001 From: Austin Parker Date: Mon, 27 Nov 2023 13:06:42 -0500 Subject: [PATCH 02/11] fix lint --- .github/workflows/run-integration-tests.yml | 25 ++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml index f87c0c4383..37728681e6 100644 --- a/.github/workflows/run-integration-tests.yml +++ b/.github/workflows/run-integration-tests.yml @@ -1,3 +1,5 @@ +# Copyright The OpenTelemetry Authors +# SPDX-License-Identifier: Apache-2.0 name: Integration Tests on: @@ -11,27 +13,24 @@ jobs: runs-on: ubuntu-latest if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - - name: metal-runner-action - uses: equinix-labs/metal-action-runner@v0.1.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - metal_auth_token: ${{ secrets.METAL_AUTH_TOKEN }} - metal_project_id: ${{ secrets.METAL_PROJECT_ID }} - metro: "da" - plan: "c3.small.x86" - os: "ubuntu_20_04" - + - name: metal-runner-action + uses: equinix-labs/metal-action-runner@v0.1.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + metal_auth_token: ${{ secrets.METAL_AUTH_TOKEN }} + metal_project_id: ${{ secrets.METAL_PROJECT_ID }} + metro: "da" + plan: "c3.small.x86" + os: "ubuntu_20_04" run_tests: needs: build_runner runs-on: self-hosted - steps: - name: check out code uses: actions/checkout@v3 - name: run tracetesting run: | make run-tracetesting - destroy: needs: [build_runner, run_tests] runs-on: ubuntu-latest @@ -41,4 +40,4 @@ jobs: with: authToken: ${{ secrets.METAL_AUTH_TOKEN }} projectID: ${{ secrets.METAL_PROJECT_ID }} - keepProject: true \ No newline at end of file + keepProject: true From 34a08956720895a051dae04ab66f947dbcd015e1 Mon Sep 17 00:00:00 2001 From: Austin Parker Date: Mon, 27 Nov 2023 13:07:45 -0500 Subject: [PATCH 03/11] fix name --- .github/workflows/run-integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml index 37728681e6..7c787bf6d4 100644 --- a/.github/workflows/run-integration-tests.yml +++ b/.github/workflows/run-integration-tests.yml @@ -36,7 +36,7 @@ jobs: runs-on: ubuntu-latest steps: - name: metal-sweeper-action - uses: equinix-labs/metal-action-sweeper@v0.6.0 + uses: equinix-labs/metal-sweeper-action@v0.6.1 with: authToken: ${{ secrets.METAL_AUTH_TOKEN }} projectID: ${{ secrets.METAL_PROJECT_ID }} From b292470e5606baf58e64404cff9a00e32455b51a Mon Sep 17 00:00:00 2001 From: Austin Parker Date: Mon, 27 Nov 2023 13:15:47 -0500 Subject: [PATCH 04/11] fix run --- .github/workflows/run-integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml index 7c787bf6d4..2c0e9182d3 100644 --- a/.github/workflows/run-integration-tests.yml +++ b/.github/workflows/run-integration-tests.yml @@ -4,7 +4,7 @@ name: Integration Tests on: workflow_run: - workflows: ["Checks"] + workflows: ["build_images"] types: - completed From a850ac26f75ec6c740f902f3a0ec0baaec11bfda Mon Sep 17 00:00:00 2001 From: Austin Parker Date: Mon, 27 Nov 2023 13:23:23 -0500 Subject: [PATCH 05/11] change calling behavior --- .github/workflows/checks.yml | 5 +++++ .github/workflows/run-integration-tests.yml | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 0a0b5adcf0..87d71205db 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -16,6 +16,11 @@ jobs: push: false version: 'dev' + run_ci: + needs: build_images + if: ${{ needs.build_images.result == 'success' }} + uses: ./.github/workflows/run-integration-tests.yml + markdownlint: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml index 2c0e9182d3..1c90764c2c 100644 --- a/.github/workflows/run-integration-tests.yml +++ b/.github/workflows/run-integration-tests.yml @@ -3,15 +3,15 @@ name: Integration Tests on: - workflow_run: - workflows: ["build_images"] - types: - - completed + push: + paths: + - 'src/**' + - 'test/**' + workflow_call: jobs: build_runner: runs-on: ubuntu-latest - if: ${{ github.event.workflow_run.conclusion == 'success' }} steps: - name: metal-runner-action uses: equinix-labs/metal-action-runner@v0.1.1 From b1da5df6feed8e2374f12eca93f884f48a5c3767 Mon Sep 17 00:00:00 2001 From: Austin Parker Date: Mon, 27 Nov 2023 13:26:30 -0500 Subject: [PATCH 06/11] add job names --- .github/workflows/run-integration-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml index 1c90764c2c..57be4ffcbf 100644 --- a/.github/workflows/run-integration-tests.yml +++ b/.github/workflows/run-integration-tests.yml @@ -12,6 +12,7 @@ on: jobs: build_runner: runs-on: ubuntu-latest + name: "Build Runner" steps: - name: metal-runner-action uses: equinix-labs/metal-action-runner@v0.1.1 @@ -25,6 +26,7 @@ jobs: run_tests: needs: build_runner runs-on: self-hosted + name: "Run CI" steps: - name: check out code uses: actions/checkout@v3 @@ -34,6 +36,7 @@ jobs: destroy: needs: [build_runner, run_tests] runs-on: ubuntu-latest + name: "Cleanup" steps: - name: metal-sweeper-action uses: equinix-labs/metal-sweeper-action@v0.6.1 From 934ab74d099a4fce90d1b0fc9498d3dcb4276174 Mon Sep 17 00:00:00 2001 From: Austin Parker Date: Mon, 27 Nov 2023 14:27:56 -0500 Subject: [PATCH 07/11] change secret --- .github/workflows/run-integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml index 57be4ffcbf..4ccaa8f82b 100644 --- a/.github/workflows/run-integration-tests.yml +++ b/.github/workflows/run-integration-tests.yml @@ -17,7 +17,7 @@ jobs: - name: metal-runner-action uses: equinix-labs/metal-action-runner@v0.1.1 with: - github_token: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.CI_GH_TOKEN }} metal_auth_token: ${{ secrets.METAL_AUTH_TOKEN }} metal_project_id: ${{ secrets.METAL_PROJECT_ID }} metro: "da" From e1237dd8aafc18831033810be7aa6f44495772e9 Mon Sep 17 00:00:00 2001 From: Austin Parker Date: Mon, 27 Nov 2023 16:56:17 -0500 Subject: [PATCH 08/11] inherit secrets --- .github/workflows/checks.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 87d71205db..98b3eec3eb 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -20,6 +20,7 @@ jobs: needs: build_images if: ${{ needs.build_images.result == 'success' }} uses: ./.github/workflows/run-integration-tests.yml + secrets: inherit markdownlint: runs-on: ubuntu-latest From 9f04f3d60d1a24ecaf24732982262e30f8ae3428 Mon Sep 17 00:00:00 2001 From: Austin Parker Date: Mon, 27 Nov 2023 20:48:16 -0500 Subject: [PATCH 09/11] change to pull_request_target --- .github/workflows/run-integration-tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml index 4ccaa8f82b..6df17267fc 100644 --- a/.github/workflows/run-integration-tests.yml +++ b/.github/workflows/run-integration-tests.yml @@ -3,7 +3,7 @@ name: Integration Tests on: - push: + pull_request_target: paths: - 'src/**' - 'test/**' @@ -17,7 +17,7 @@ jobs: - name: metal-runner-action uses: equinix-labs/metal-action-runner@v0.1.1 with: - github_token: ${{ secrets.CI_GH_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} metal_auth_token: ${{ secrets.METAL_AUTH_TOKEN }} metal_project_id: ${{ secrets.METAL_PROJECT_ID }} metro: "da" @@ -30,6 +30,8 @@ jobs: steps: - name: check out code uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha}} - name: run tracetesting run: | make run-tracetesting From ad4d7cfae6d64ee85f9d21e3edb933cb2a0d6c2e Mon Sep 17 00:00:00 2001 From: Austin Parker Date: Mon, 27 Nov 2023 20:53:29 -0500 Subject: [PATCH 10/11] remove secret inheritance --- .github/workflows/checks.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 98b3eec3eb..87d71205db 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -20,7 +20,6 @@ jobs: needs: build_images if: ${{ needs.build_images.result == 'success' }} uses: ./.github/workflows/run-integration-tests.yml - secrets: inherit markdownlint: runs-on: ubuntu-latest From fa6cf6d516b31744866633257809e628d2f2d500 Mon Sep 17 00:00:00 2001 From: Austin Parker Date: Mon, 27 Nov 2023 21:40:51 -0500 Subject: [PATCH 11/11] change to run on pr merge --- .github/workflows/checks.yml | 5 ----- .github/workflows/run-integration-tests.yml | 12 +++++------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 87d71205db..0a0b5adcf0 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -16,11 +16,6 @@ jobs: push: false version: 'dev' - run_ci: - needs: build_images - if: ${{ needs.build_images.result == 'success' }} - uses: ./.github/workflows/run-integration-tests.yml - markdownlint: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml index 6df17267fc..833f0ae9fa 100644 --- a/.github/workflows/run-integration-tests.yml +++ b/.github/workflows/run-integration-tests.yml @@ -3,16 +3,16 @@ name: Integration Tests on: - pull_request_target: - paths: - - 'src/**' - - 'test/**' - workflow_call: + pull_request: + branches: + - main + types: [closed] jobs: build_runner: runs-on: ubuntu-latest name: "Build Runner" + if: github.event.pull_request.merged == true steps: - name: metal-runner-action uses: equinix-labs/metal-action-runner@v0.1.1 @@ -30,8 +30,6 @@ jobs: steps: - name: check out code uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.head.sha}} - name: run tracetesting run: | make run-tracetesting