Skip to content

Commit

Permalink
Merge branch 'etcd-io:main' into greenmoon55-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
greenmoon55 authored Nov 28, 2023
2 parents 00ce011 + 03d5512 commit f2d718e
Show file tree
Hide file tree
Showing 78 changed files with 2,538 additions and 1,982 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
uses: github/codeql-action/init@66b90a5db151a8042fa97405c6cf843bbe433f7b # v2.22.7
with:
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
Expand All @@ -50,6 +50,6 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
uses: github/codeql-action/autobuild@66b90a5db151a8042fa97405c6cf843bbe433f7b # v2.22.7
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
uses: github/codeql-action/analyze@66b90a5db151a8042fa97405c6cf843bbe433f7b # v2.22.7
21 changes: 0 additions & 21 deletions .github/workflows/e2e-arm64-nightly.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
---
name: Reusable Arm64 E2E Workflow
on:
workflow_call:
inputs:
etcdBranch:
required: true
type: string
name: E2E-Arm64
on: [push, pull_request]
permissions: read-all
jobs:
test:
Expand All @@ -19,8 +14,6 @@ jobs:
- linux-arm64-e2e
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: "${{ inputs.etcdBranch }}"
- id: goversion
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/gh-workflow-approve.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Approve GitHub Workflows

on:
pull_request_target:
types:
- labeled
- synchronize
branches:
- main

jobs:
approve:
name: Approve ok-to-test
if: contains(github.event.pull_request.labels.*.name, 'ok-to-test')
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Update PR
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
continue-on-error: true
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
debug: ${{ secrets.ACTIONS_RUNNER_DEBUG == 'true' }}
script: |
const result = await github.rest.actions.listWorkflowRunsForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
event: "pull_request",
status: "action_required",
head_sha: context.payload.pull_request.head.sha,
per_page: 100
});
for (var run of result.data.workflow_runs) {
await github.rest.actions.approveWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: run.id
});
}
8 changes: 8 additions & 0 deletions .github/workflows/robustness.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ jobs:
testTimeout: 30m
artifactName: main
runs-on: "['ubuntu-latest-8-cores']"
main-arm64:
uses: ./.github/workflows/robustness-template.yaml
with:
etcdBranch: main
count: 12
testTimeout: 30m
artifactName: main-arm64
runs-on: "['actuated-arm64-8cpu-32gb']"
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v2.22.5
uses: github/codeql-action/upload-sarif@66b90a5db151a8042fa97405c6cf843bbe433f7b # v2.22.7
with:
sarif_file: results.sarif
4 changes: 3 additions & 1 deletion .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ jobs:
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ steps.goversion.outputs.goversion }}
- id: golangci_lint_version
run: echo "golangci_lint_version=$(cd tools/mod && go list -m -f {{.Version}} github.com/golangci/golangci-lint)" >> "$GITHUB_OUTPUT"
- name: golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0
with:
version: v1.53.3
version: ${{ steps.golangci_lint_version.outputs.golangci_lint_version }}
args: --config tools/.golangci.yaml
- name: protoc
uses: arduino/setup-protoc@149f6c87b92550901b26acd1632e11c3662e381f # v1.3.0
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/tests-arm64-nightly.yaml

This file was deleted.

69 changes: 0 additions & 69 deletions .github/workflows/tests-arm64-template.yaml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/tests-template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
name: Reusable Tests Workflow
on:
workflow_call:
inputs:
arch:
required: true
type: string
runs-on:
required: true
type: string
permissions: read-all

jobs:
test:
runs-on: ${{ inputs.runs-on }}
# this is to prevent arm64 jobs from running at forked projects
if: inputs.arch == 'amd64' || github.repository == 'etcd-io/etcd'
strategy:
fail-fast: false
matrix:
target:
- linux-${{ inputs.arch }}-integration-1-cpu
- linux-${{ inputs.arch }}-integration-2-cpu
- linux-${{ inputs.arch }}-integration-4-cpu
- linux-${{ inputs.arch }}-unit-4-cpu
- linux-386-unit-1-cpu
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- id: goversion
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ steps.goversion.outputs.goversion }}
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
go clean -testcache
mkdir "${TARGET}"
export JUNIT_REPORT_DIR=$(realpath ${TARGET})
case "${TARGET}" in
linux-${{ inputs.arch }}-integration-1-cpu)
make gofail-enable
GOOS=linux GOARCH=${{ inputs.arch }} CPU=1 make test-integration
;;
linux-${{ inputs.arch }}-integration-2-cpu)
make gofail-enable
GOOS=linux GOARCH=${{ inputs.arch }} CPU=2 make test-integration
;;
linux-${{ inputs.arch }}-integration-4-cpu)
make gofail-enable
GOOS=linux GOARCH=${{ inputs.arch }} CPU=4 make test-integration
;;
linux-${{ inputs.arch }}-unit-4-cpu)
GOOS=linux GOARCH=${{ inputs.arch }} CPU=4 GO_TEST_FLAGS='-p=2' make test-unit
;;
linux-386-unit-1-cpu)
# skip running single-threaded 386 unit tests only if arch is arm64
if [ "${{ inputs.arch }}" == "arm64" ]; then exit; fi
GOOS=linux GOARCH=386 CPU=1 GO_TEST_FLAGS='-p=4' make test-unit
;;
*)
echo "Failed to find target"
exit 1
;;
esac
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
if: always()
with:
path: ./**/junit_*.xml
64 changes: 10 additions & 54 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,57 +3,13 @@ name: Tests
on: [push, pull_request]
permissions: read-all
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- linux-amd64-integration-1-cpu
- linux-amd64-integration-2-cpu
- linux-amd64-integration-4-cpu
- linux-amd64-unit-4-cpu
- linux-386-unit-1-cpu
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- id: goversion
run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ${{ steps.goversion.outputs.goversion }}
- env:
TARGET: ${{ matrix.target }}
run: |
set -euo pipefail
go clean -testcache
mkdir "${TARGET}"
export JUNIT_REPORT_DIR=$(realpath ${TARGET})
case "${TARGET}" in
linux-amd64-integration-1-cpu)
make gofail-enable
GOOS=linux GOARCH=amd64 CPU=1 make test-integration
;;
linux-amd64-integration-2-cpu)
make gofail-enable
GOOS=linux GOARCH=amd64 CPU=2 make test-integration
;;
linux-amd64-integration-4-cpu)
make gofail-enable
GOOS=linux GOARCH=amd64 CPU=4 make test-integration
;;
linux-amd64-unit-4-cpu)
GOOS=linux GOARCH=amd64 CPU=4 GO_TEST_FLAGS='-p=2' make test-unit
;;
linux-386-unit-1-cpu)
GOOS=linux GOARCH=386 CPU=1 GO_TEST_FLAGS='-p=4' make test-unit
;;
*)
echo "Failed to find target"
exit 1
;;
esac
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
if: always()
with:
path: ./**/junit_*.xml
amd64:
uses: ./.github/workflows/tests-template.yaml
with:
arch: amd64
runs-on: ubuntu-latest
arm64:
uses: ./.github/workflows/tests-template.yaml
with:
arch: arm64
runs-on: actuated-arm64-8cpu-32gb
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.3
1.21.4
Loading

0 comments on commit f2d718e

Please sign in to comment.