forked from tikv/pd
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: update github action (tikv#4575)
* build: update GitHub Actions ref tikv#4399 Signed-off-by: disksing <i@disksing.com> * tidy Signed-off-by: disksing <i@disksing.com> * move docker out of check Signed-off-by: disksing <i@disksing.com> * Update scripts/ci-subtask.sh Co-authored-by: JmPotato <ghzpotato@gmail.com> Signed-off-by: disksing <i@disksing.com> * clean up Signed-off-by: disksing <i@disksing.com> * 6 workers for pd-tests Signed-off-by: disksing <i@disksing.com> * merge together Signed-off-by: disksing <i@disksing.com> * minor update Signed-off-by: disksing <i@disksing.com> * simplify test Signed-off-by: disksing <i@disksing.com> Co-authored-by: JmPotato <ghzpotato@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
- Loading branch information
1 parent
e14e784
commit 82196bc
Showing
8 changed files
with
84 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: PD Docker Image | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
chunks: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
steps: | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Make | ||
run: make docker-image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# ./ci-subtask.sh <TOTAL_TASK_N> <TASK_INDEX> | ||
|
||
packages=(`go list ./...`) | ||
dirs=(`find . -iname "*_test.go" -exec dirname {} \; | sort -u | sed -e "s/^\./github.com\/tikv\/pd/"`) | ||
tasks=($(comm -12 <(printf "%s\n" "${packages[@]}") <(printf "%s\n" "${dirs[@]}"))) | ||
|
||
weight () { | ||
[[ $1 == "github.com/tikv/pd/server/api" ]] && return 30 | ||
[[ $1 == "github.com/tikv/pd/server/schedule" ]] && return 30 | ||
[[ $1 == "github.com/tikv/pd/tests/client" ]] && return 30 | ||
[[ $1 =~ "pd/tests" ]] && return 5 | ||
return 1 | ||
} | ||
|
||
scores=(`seq "$1" | xargs -I{} echo 0`) | ||
|
||
res=() | ||
for t in ${tasks[@]}; do | ||
min_i=0 | ||
for i in ${!scores[@]}; do | ||
[[ ${scores[i]} -lt ${scores[$min_i]} ]] && min_i=$i | ||
done | ||
weight $t | ||
scores[$min_i]=$((${scores[$min_i]} + $?)) | ||
[[ $(($min_i+1)) -eq $2 ]] && res+=($t) | ||
done | ||
|
||
printf "%s " "${res[@]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters