From 4ea8da7df24506e3cef17932381815d9bf1de5e2 Mon Sep 17 00:00:00 2001 From: James Blair Date: Thu, 29 Jun 2023 20:39:09 +1200 Subject: [PATCH 1/2] Templated arm64 integration workflows for main and release-3.5. Signed-off-by: James Blair --- .github/workflows/tests-arm64-nightly.yaml | 22 ++++++++++++ ...s-arm64.yaml => tests-arm64-template.yaml} | 36 +++++++++++++------ 2 files changed, 48 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/tests-arm64-nightly.yaml rename .github/workflows/{tests-arm64.yaml => tests-arm64-template.yaml} (63%) diff --git a/.github/workflows/tests-arm64-nightly.yaml b/.github/workflows/tests-arm64-nightly.yaml new file mode 100644 index 00000000000..7ebf79a6f4e --- /dev/null +++ b/.github/workflows/tests-arm64-nightly.yaml @@ -0,0 +1,22 @@ +--- +name: Integration Arm64 Nightly +permissions: read-all +on: + # schedules always run against the main branch, hence we have to create separate jobs + # with individual checkout actions for each of the active release branches + schedule: + - cron: '30 2 * * *' # runs daily at 2:30 am. +jobs: + main-arm64: + uses: ./.github/workflows/tests-arm64-template.yaml + with: + etcdBranch: main + integrationTestCmd: make test-integration + unitTestCmd: GO_TEST_FLAGS='-p=2' make test-unit + release-35-arm64: + uses: ./.github/workflows/tests-arm64-template.yaml + with: + etcdBranch: release-3.5 + integrationTestCmd: PASSES='integration' RACE='false' ./test.sh + unitTestCmd: PASSES='unit' CPU='4' ./test.sh -p=2 + gofailMake: "no" diff --git a/.github/workflows/tests-arm64.yaml b/.github/workflows/tests-arm64-template.yaml similarity index 63% rename from .github/workflows/tests-arm64.yaml rename to .github/workflows/tests-arm64-template.yaml index f92e7648fc9..98c062445c3 100644 --- a/.github/workflows/tests-arm64.yaml +++ b/.github/workflows/tests-arm64-template.yaml @@ -1,9 +1,23 @@ --- -name: Tests-arm64 +name: Reusable Arm64 Integration Workflow on: - schedule: - - cron: '30 1 * * *' # runs daily at 1:30 am. + workflow_call: + inputs: + etcdBranch: + required: true + type: string + integrationTestCmd: + required: true + type: string + unitTestCmd: + required: true + type: string + gofailMake: + required: false + type: string + default: "yes" permissions: read-all + jobs: test: # this is to prevent the job to run at forked projects @@ -23,6 +37,8 @@ jobs: - linux-arm64-unit-4-cpu-race steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + with: + ref: "${{ inputs.etcdBranch }}" # https://github.com/actions/checkout/issues/1169 - run: git config --system --add safe.directory '*' - id: goversion @@ -40,19 +56,19 @@ jobs: export JUNIT_REPORT_DIR=$(realpath ${TARGET}) case "${TARGET}" in linux-arm64-integration-1-cpu) - make gofail-enable - GOOS=linux GOARCH=arm64 CPU=1 make test-integration + if [ "${{ inputs.gofailMake }}" == "yes" ]; then make gofail-enable; fi + GOOS=linux GOARCH=arm64 CPU=1 ${{ inputs.integrationTestCmd }} ;; linux-arm64-integration-2-cpu) - make gofail-enable - GOOS=linux GOARCH=arm64 CPU=2 make test-integration + if [ "${{ inputs.gofailMake }}" == "yes" ]; then make gofail-enable; fi + GOOS=linux GOARCH=arm64 CPU=2 ${{ inputs.integrationTestCmd }} ;; linux-arm64-integration-4-cpu) - make gofail-enable - GOOS=linux GOARCH=arm64 CPU=4 make test-integration + if [ "${{ inputs.gofailMake }}" == "yes" ]; then make gofail-enable; fi + GOOS=linux GOARCH=arm64 CPU=4 ${{ inputs.integrationTestCmd }} ;; linux-arm64-unit-4-cpu-race) - GOOS=linux GOARCH=arm64 CPU=4 RACE=true GO_TEST_FLAGS='-p=2' make test-unit + GOOS=linux GOARCH=arm64 CPU=4 RACE=true ${{ inputs.unitTestCmd }} ;; *) echo "Failed to find target" From 856790de368f0c12f7c7c4f40754236560c4da66 Mon Sep 17 00:00:00 2001 From: James Blair Date: Thu, 29 Jun 2023 20:39:15 +1200 Subject: [PATCH 2/2] Templated arm64 e2e workflows for main and release-3.5. Signed-off-by: James Blair --- .github/workflows/e2e-arm64-nightly.yaml | 19 +++++++++++++++++++ ...e2e-arm64.yaml => e2e-arm64-template.yaml} | 16 ++++++++++++---- 2 files changed, 31 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/e2e-arm64-nightly.yaml rename .github/workflows/{e2e-arm64.yaml => e2e-arm64-template.yaml} (81%) diff --git a/.github/workflows/e2e-arm64-nightly.yaml b/.github/workflows/e2e-arm64-nightly.yaml new file mode 100644 index 00000000000..06c6298c0dc --- /dev/null +++ b/.github/workflows/e2e-arm64-nightly.yaml @@ -0,0 +1,19 @@ +--- +name: E2E Arm64 Nightly +permissions: read-all +on: + # schedules always run against the main branch, hence we have to create separate jobs + # with individual checkout actions for each of the active release branches + schedule: + - cron: '30 1 * * *' # runs daily at 1:30 am. +jobs: + main-arm64: + uses: ./.github/workflows/e2e-arm64-template.yaml + with: + etcdBranch: main + e2eTestCmd: make test-e2e-release + release-35-arm64: + uses: ./.github/workflows/e2e-arm64-template.yaml + with: + etcdBranch: release-3.5 + e2eTestCmd: PASSES='build e2e' COVER='false' ./test.sh diff --git a/.github/workflows/e2e-arm64.yaml b/.github/workflows/e2e-arm64-template.yaml similarity index 81% rename from .github/workflows/e2e-arm64.yaml rename to .github/workflows/e2e-arm64-template.yaml index 1612b49700f..2251bc4e124 100644 --- a/.github/workflows/e2e-arm64.yaml +++ b/.github/workflows/e2e-arm64-template.yaml @@ -1,8 +1,14 @@ --- -name: E2E-arm64 +name: Reusable Arm64 E2E Workflow on: - schedule: - - cron: '0 1 * * *' # runs daily at 1am. + workflow_call: + inputs: + etcdBranch: + required: true + type: string + e2eTestCmd: + required: false + type: string permissions: read-all jobs: test: @@ -20,6 +26,8 @@ jobs: - linux-arm64-e2e steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + with: + ref: "${{ inputs.etcdBranch }}" # https://github.com/actions/checkout/issues/1169 - run: git config --system --add safe.directory '*' - id: goversion @@ -36,7 +44,7 @@ jobs: echo "${TARGET}" case "${TARGET}" in linux-arm64-e2e) - GOOS=linux GOARCH=arm64 CPU=4 EXPECT_DEBUG=true RACE=true make test-e2e-release + GOOS=linux GOARCH=arm64 CPU=4 EXPECT_DEBUG=true RACE=true ${{ inputs.e2eTestCmd }} ;; *) echo "Failed to find target"