Skip to content

Commit 47d0387

Browse files
committed
Revert remove all github actions test workflows
All tests were removed in etcd-io#20099, etcd-io#20236 and etcd-io#20315 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 47d0387

File tree

7 files changed

+248
-0
lines changed

7 files changed

+248
-0
lines changed

.github/workflows/e2e.yaml

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

.github/workflows/functional.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: functional-tests
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
fail-fast: true
8+
matrix:
9+
target:
10+
- linux-amd64-functional
11+
steps:
12+
- uses: actions/checkout@v2
13+
- id: goversion
14+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
15+
- uses: actions/setup-go@v2
16+
with:
17+
go-version: ${{ steps.goversion.outputs.goversion }}
18+
- run: date
19+
- env:
20+
TARGET: ${{ matrix.target }}
21+
run: |
22+
set -euo pipefail
23+
24+
echo "${TARGET}"
25+
case "${TARGET}" in
26+
linux-amd64-functional)
27+
GO_BUILD_FLAGS='-v -mod=readonly' ./build && GOARCH=amd64 PASSES='functional' ./test
28+
;;
29+
*)
30+
echo "Failed to find target"
31+
exit 1
32+
;;
33+
esac

.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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
10+
- id: goversion
11+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
12+
- uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
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 | xargs -I'{}' /bin/bash -c 'echo scanning $(dirname {}); govulncheck -C $(dirname {}) -show verbose ./...'

.github/workflows/grpcproxy.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: grpcProxy-tests
2+
on: [push, pull_request]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
fail-fast: true
8+
matrix:
9+
target:
10+
- linux-amd64-grpcproxy
11+
steps:
12+
- uses: actions/checkout@v2
13+
- id: goversion
14+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
15+
- uses: actions/setup-go@v2
16+
with:
17+
go-version: ${{ steps.goversion.outputs.goversion }}
18+
- run: date
19+
- env:
20+
TARGET: ${{ matrix.target }}
21+
run: |
22+
set -euo pipefail
23+
24+
echo "${TARGET}"
25+
case "${TARGET}" in
26+
linux-amd64-grpcproxy)
27+
PASSES='build grpcproxy' CPU='4' COVER='false' RACE='true' ./test.sh
28+
;;
29+
*)
30+
echo "Failed to find target"
31+
exit 1
32+
;;
33+
esac
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
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@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
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+
set -euo pipefail
17+
18+
make verify
19+
- run: |
20+
set -euo pipefail
21+
22+
make fix
23+
24+
DIFF=$(git status --porcelain)
25+
26+
if [ -n "$DIFF" ]; then
27+
echo "These files were modified:"
28+
echo
29+
echo "$DIFF"
30+
echo
31+
exit 1
32+
fi
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
targets:
13+
required: false
14+
type: string
15+
16+
jobs:
17+
test:
18+
runs-on: ${{ inputs.runs-on }}
19+
# this is to prevent arm64 jobs from running at forked projects
20+
if: inputs.arch == 'amd64' || github.repository == 'etcd-io/etcd'
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
target: ${{ fromJSON(inputs.targets) }}
25+
steps:
26+
- uses: actions/checkout@v2
27+
- id: goversion
28+
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
29+
- uses: actions/setup-go@v2
30+
with:
31+
go-version: ${{ steps.goversion.outputs.goversion }}
32+
- run: date
33+
- env:
34+
TARGET: ${{ matrix.target }}
35+
run: |
36+
set -euo pipefail
37+
38+
echo "${TARGET}"
39+
case "${TARGET}" in
40+
linux-test-smoke)
41+
GOARCH=${{ inputs.arch }} CPU=4 RACE='false' make test-smoke
42+
;;
43+
linux-integration-1-cpu)
44+
make install-gofail
45+
GOARCH=${{ inputs.arch }} CPU=1 RACE='false' FAILPOINTS='true' make test-integration
46+
;;
47+
linux-integration-2-cpu)
48+
make install-gofail
49+
GOARCH=${{ inputs.arch }} CPU=2 RACE='false' FAILPOINTS='true' make test-integration
50+
;;
51+
linux-integration-4-cpu)
52+
make install-gofail
53+
GOARCH=${{ inputs.arch }} CPU=4 RACE='false' FAILPOINTS='true' make test-integration
54+
;;
55+
linux-unit-4-cpu-race)
56+
GOARCH=${{ inputs.arch }} RACE='true' CPU='4' GO_TEST_FLAGS='-p=2' make test-unit
57+
;;
58+
linux-386-unit-1-cpu)
59+
GOOS=linux GOARCH=386 CPU=1 GO_TEST_FLAGS='-p=4' make test-unit
60+
;;
61+
all-build)
62+
GOARCH=amd64 PASSES='build' ./test.sh
63+
GOARCH=386 PASSES='build' ./test.sh
64+
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=amd64 ./build.sh
65+
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=arm64 ./build.sh
66+
GO_BUILD_FLAGS='-v -mod=readonly' GOOS=windows GOARCH=amd64 ./build.sh
67+
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm ./build.sh
68+
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm64 ./build.sh
69+
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=ppc64le ./build.sh
70+
GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=s390x ./build.sh
71+
;;
72+
*)
73+
echo "Failed to find target"
74+
exit 1
75+
;;
76+
esac

.github/workflows/tests.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Tests
2+
on: [push, pull_request]
3+
jobs:
4+
amd64:
5+
uses: ./.github/workflows/tests-template.yaml
6+
with:
7+
arch: amd64
8+
runs-on: ubuntu-latest
9+
targets: "['linux-test-smoke',
10+
'linux-integration-1-cpu',
11+
'linux-integration-2-cpu',
12+
'linux-integration-4-cpu',
13+
'linux-unit-4-cpu-race',
14+
'linux-386-unit-1-cpu',
15+
'all-build']"

0 commit comments

Comments
 (0)