Skip to content

Commit 5364ebc

Browse files
committed
Revert remove all github actions test workflows
All tests were removed in etcd-io#18249, etcd-io#18454, etcd-io#18714, etcd-io#19550, etcd-io#19551 as part of the upstream migration to prow kubernetes/test-infra#32754. Since we maintain a fork without tests running in prow, we want to maintain the tests in github actions. Hence this commit reverts the three pull requests mentioned above with the exception of release.yaml since we do not use the docker images built in this repository. Signed-off-by: Ayaz Badouraly <[email protected]>
1 parent b008ede commit 5364ebc

File tree

8 files changed

+295
-0
lines changed

8 files changed

+295
-0
lines changed

.github/workflows/e2e-arm64.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: E2E-Arm64
3+
on: [push, pull_request]
4+
permissions: read-all
5+
jobs:
6+
test:
7+
# this is to prevent the job to run at forked projects
8+
if: github.repository == 'etcd-io/etcd'
9+
runs-on: actuated-arm64-8cpu-8gb
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
target:
14+
- linux-arm64-e2e
15+
steps:
16+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
17+
- id: goversion
18+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
19+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
20+
with:
21+
go-version: ${{ steps.goversion.outputs.goversion }}
22+
- env:
23+
TARGET: ${{ matrix.target }}
24+
run: |
25+
set -euo pipefail
26+
go clean -testcache
27+
28+
echo "${TARGET}"
29+
case "${TARGET}" in
30+
linux-arm64-e2e)
31+
GOOS=linux GOARCH=arm64 CPU=4 EXPECT_DEBUG=true make test-e2e-release
32+
;;
33+
*)
34+
echo "Failed to find target"
35+
exit 1
36+
;;
37+
esac

.github/workflows/e2e.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: E2E
3+
on: [push, pull_request]
4+
permissions: read-all
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
target:
12+
- linux-amd64-e2e
13+
- linux-386-e2e
14+
steps:
15+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
16+
- id: goversion
17+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
18+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
19+
with:
20+
go-version: ${{ steps.goversion.outputs.goversion }}
21+
- env:
22+
TARGET: ${{ matrix.target }}
23+
run: |
24+
set -euo pipefail
25+
go clean -testcache
26+
27+
echo "${TARGET}"
28+
case "${TARGET}" in
29+
linux-amd64-e2e)
30+
make gofail-enable
31+
VERBOSE=1 GOOS=linux GOARCH=amd64 CPU=4 EXPECT_DEBUG=true make test-e2e-release
32+
;;
33+
linux-386-e2e)
34+
VERBOSE=1 GOOS=linux GOARCH=386 CPU=4 EXPECT_DEBUG=true make test-e2e
35+
;;
36+
*)
37+
echo "Failed to find target"
38+
exit 1
39+
;;
40+
esac

.github/workflows/fuzzing.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Fuzzing v3rpc
3+
on: [push, pull_request]
4+
permissions: read-all
5+
jobs:
6+
fuzzing:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
env:
11+
TARGET_PATH: ./server/etcdserver/api/v3rpc
12+
steps:
13+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
14+
- id: goversion
15+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
16+
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
17+
with:
18+
go-version: ${{ steps.goversion.outputs.goversion }}
19+
- run: |
20+
set -euo pipefail
21+
GOARCH=amd64 CPU=4 make fuzz
22+
- uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
23+
if: failure()
24+
with:
25+
path: "${{env.TARGET_PATH}}/testdata/fuzz/**/*"

.github/workflows/govuln.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: Go Vulnerability Checker
3+
on: [push, pull_request]
4+
permissions: read-all
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
10+
- id: goversion
11+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
12+
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
13+
with:
14+
go-version: ${{ steps.goversion.outputs.goversion }}
15+
- run: date
16+
- run: |
17+
set -euo pipefail
18+
19+
go install golang.org/x/vuln/cmd/govulncheck@latest
20+
21+
find -name go.mod -exec /bin/bash -c 'echo scanning $(dirname {}); govulncheck -C $(dirname {}) -show verbose ./...' \;

.github/workflows/grpcproxy.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: grpcProxy-tests
3+
on: [push, pull_request]
4+
permissions: read-all
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: false
10+
matrix:
11+
target:
12+
- linux-amd64-grpcproxy-integration
13+
- linux-amd64-grpcproxy-e2e
14+
steps:
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
- id: goversion
17+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
18+
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
19+
with:
20+
go-version: ${{ steps.goversion.outputs.goversion }}
21+
- env:
22+
TARGET: ${{ matrix.target }}
23+
run: |
24+
set -euo pipefail
25+
26+
echo "${TARGET}"
27+
case "${TARGET}" in
28+
linux-amd64-grpcproxy-integration)
29+
GOOS=linux GOARCH=amd64 CPU=4 make test-grpcproxy-integration
30+
;;
31+
linux-amd64-grpcproxy-e2e)
32+
GOOS=linux GOARCH=amd64 CPU=4 make test-grpcproxy-e2e
33+
;;
34+
*)
35+
echo "Failed to find target"
36+
exit 1
37+
;;
38+
esac
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
name: Static Analysis
3+
on: [push, pull_request]
4+
permissions: read-all
5+
jobs:
6+
run:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
10+
- id: goversion
11+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
12+
- uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
13+
with:
14+
go-version: ${{ steps.goversion.outputs.goversion }}
15+
- run: |
16+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@"$(cd tools/mod && go list -m -f {{.Version}} github.com/golangci/golangci-lint)"
17+
- name: protoc
18+
uses: arduino/setup-protoc@149f6c87b92550901b26acd1632e11c3662e381f # v1.3.0
19+
with:
20+
version: '3.20.3'
21+
repo-token: ${{ secrets.GITHUB_TOKEN }}
22+
- uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: stable
25+
- run: |
26+
set -euo pipefail
27+
28+
cargo install marker --version 0.9.0
29+
- run: |
30+
set -euo pipefail
31+
32+
make verify
33+
- run: |
34+
set -euo pipefail
35+
36+
make fix
37+
38+
DIFF=$(git status --porcelain)
39+
40+
if [ -n "$DIFF" ]; then
41+
echo "These files were modified:"
42+
echo
43+
echo "$DIFF"
44+
echo
45+
exit 1
46+
fi
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
name: Reusable Tests Workflow
3+
on:
4+
workflow_call:
5+
inputs:
6+
arch:
7+
required: true
8+
type: string
9+
runs-on:
10+
required: true
11+
type: string
12+
permissions: read-all
13+
14+
jobs:
15+
test:
16+
runs-on: ${{ inputs.runs-on }}
17+
# this is to prevent arm64 jobs from running at forked projects
18+
if: inputs.arch == 'amd64' || github.repository == 'etcd-io/etcd'
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
target:
23+
- linux-${{ inputs.arch }}-integration-1-cpu
24+
- linux-${{ inputs.arch }}-integration-2-cpu
25+
- linux-${{ inputs.arch }}-integration-4-cpu
26+
- linux-${{ inputs.arch }}-unit-4-cpu
27+
- linux-386-unit-1-cpu
28+
steps:
29+
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
30+
- id: goversion
31+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
32+
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
33+
with:
34+
go-version: ${{ steps.goversion.outputs.goversion }}
35+
- env:
36+
TARGET: ${{ matrix.target }}
37+
run: |
38+
set -euo pipefail
39+
go clean -testcache
40+
41+
mkdir "${TARGET}"
42+
export JUNIT_REPORT_DIR=$(realpath ${TARGET})
43+
case "${TARGET}" in
44+
linux-${{ inputs.arch }}-integration-1-cpu)
45+
make gofail-enable
46+
GOOS=linux GOARCH=${{ inputs.arch }} CPU=1 make test-integration
47+
;;
48+
linux-${{ inputs.arch }}-integration-2-cpu)
49+
make gofail-enable
50+
GOOS=linux GOARCH=${{ inputs.arch }} CPU=2 make test-integration
51+
;;
52+
linux-${{ inputs.arch }}-integration-4-cpu)
53+
make gofail-enable
54+
GOOS=linux GOARCH=${{ inputs.arch }} CPU=4 make test-integration
55+
;;
56+
linux-${{ inputs.arch }}-unit-4-cpu)
57+
GOOS=linux GOARCH=${{ inputs.arch }} CPU=4 GO_TEST_FLAGS='-p=2' make test-unit
58+
;;
59+
linux-386-unit-1-cpu)
60+
# skip running single-threaded 386 unit tests only if arch is arm64
61+
if [ "${{ inputs.arch }}" == "arm64" ]; then exit; fi
62+
GOOS=linux GOARCH=386 CPU=1 GO_TEST_FLAGS='-p=4' make test-unit
63+
;;
64+
*)
65+
echo "Failed to find target"
66+
exit 1
67+
;;
68+
esac
69+
- uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
70+
if: always()
71+
with:
72+
name: "${{ matrix.target }}"
73+
path: ./**/junit_*.xml

.github/workflows/tests.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Tests
3+
on: [push, pull_request]
4+
permissions: read-all
5+
jobs:
6+
amd64:
7+
uses: ./.github/workflows/tests-template.yaml
8+
with:
9+
arch: amd64
10+
runs-on: ubuntu-latest
11+
arm64:
12+
uses: ./.github/workflows/tests-template.yaml
13+
with:
14+
arch: arm64
15+
runs-on: actuated-arm64-8cpu-8gb

0 commit comments

Comments
 (0)