Merge pull request #15927 from jmhbnz/run-arm64-in-container

Run arm64 tests in containers on self hosted runners
This commit is contained in:
Benjamin Wang 2023-05-26 09:42:40 +08:00 committed by GitHub
commit bf903e5007
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 85 additions and 1 deletions

View File

@ -11,6 +11,10 @@ jobs:
if: github.repository == 'etcd-io/etcd'
runs-on: [self-hosted, Linux, ARM64]
needs: goversion
container: golang:1.19-bullseye
defaults:
run:
shell: bash
strategy:
fail-fast: true
matrix:
@ -18,6 +22,8 @@ jobs:
- linux-arm64-e2e
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
# https://github.com/actions/checkout/issues/1169
- run: git config --system --add safe.directory '*'
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}

View File

@ -15,7 +15,7 @@ jobs:
testTimeout: 200m
artifactName: main
main-arm64:
uses: ./.github/workflows/robustness-template.yaml
uses: ./.github/workflows/robustness-template-arm64.yaml
with:
etcdBranch: main
count: 100

View File

@ -0,0 +1,72 @@
name: Reusable Robustness Workflow
on:
workflow_call:
inputs:
etcdBranch:
required: true
type: string
count:
required: true
type: number
testTimeout:
required: false
type: string
default: '30m'
artifactName:
required: true
type: string
runs-on:
required: false
type: string
default: "['ubuntu-latest']"
permissions: read-all
jobs:
goversion:
uses: ./.github/workflows/go-version.yaml
test:
timeout-minutes: 210
runs-on: ${{ fromJson(inputs.runs-on) }}
needs: goversion
container: golang:1.19-bullseye
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
# https://github.com/actions/checkout/issues/1169
- run: git config --system --add safe.directory '*'
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}
- name: test-robustness
env:
ETCD_BRANCH: "${{ inputs.etcdBranch }}"
run: |
set -euo pipefail
# Use --failfast to avoid overriding report generated by failed test
GO_TEST_FLAGS="-v --count ${{ inputs.count }} --timeout ${{ inputs.testTimeout }} --failfast --run TestRobustness"
case "${ETCD_BRANCH}" in
release-3.5)
EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness-release-3.5
;;
release-3.4)
EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness-release-3.4
;;
main)
make gofail-enable
make build
EXPECT_DEBUG=true GO_TEST_FLAGS=${GO_TEST_FLAGS} RESULTS_DIR=/tmp/results make test-robustness
;;
*)
echo "Failed to find target ${ETCD_BRANCH}"
exit 1
;;
esac
- uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
if: always()
with:
name: ${{ inputs.artifactName }}
path: /tmp/results/*

View File

@ -11,6 +11,10 @@ jobs:
if: github.repository == 'etcd-io/etcd'
runs-on: [self-hosted, Linux, ARM64]
needs: goversion
container: golang:1.19-bullseye
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
@ -21,6 +25,8 @@ jobs:
- linux-arm64-unit-4-cpu-race
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
# https://github.com/actions/checkout/issues/1169
- run: git config --system --add safe.directory '*'
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.goversion.outputs.goversion }}