-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moving loadtestpre into setup environment
- Loading branch information
Azfaar Qureshi
committed
Dec 18, 2020
1 parent
46e2ce8
commit 71e2b1a
Showing
1 changed file
with
23 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,27 @@ jobs: | |
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | ||
- name: Install tools | ||
run: make install-tools | ||
- name: split loadtest jobs | ||
id: splitloadtest | ||
run: | | ||
TESTS="$(make -s testbed-list-loadtest | xargs echo|sed 's/ /|/g')" | ||
TESTS=(${TESTS//|/ }) | ||
MATRIX="{\"include\":[" | ||
curr="" | ||
for i in "${!TESTS[@]}"; do | ||
if (( i > 0 && i % 2 == 0 )); then | ||
curr+="|${TESTS[$i]}" | ||
else | ||
if [ -n "$curr" ] && (( i>1 )); then | ||
MATRIX+=",{\"test\":\"$curr\"}" | ||
elif [ -n "$curr" ]; then | ||
MATRIX+="{\"test\":\"$curr\"}" | ||
fi | ||
curr="${TESTS[$i]}" | ||
fi | ||
done | ||
MATRIX+="]}" | ||
echo "::set-output name=matrix::$MATRIX" | ||
- name: Upload tool binaries | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
|
@@ -125,55 +146,12 @@ jobs: | |
with: | ||
name: collector-binaries | ||
path: ./bin | ||
loadtestpre: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.splitloadtest.outputs.matrix }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: 1.15 | ||
- name: Setup env | ||
run: | | ||
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV | ||
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | ||
- name: Restore module cache | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: cache-go-modules | ||
with: | ||
path: /home/runner/go/pkg/mod | ||
key: go-pkg-mod-${{ runner.os }}-${{ hashFiles('./go.mod') }} | ||
- name: split loadtest jobs | ||
id: splitloadtest | ||
run: | | ||
TESTS="$(make -s testbed-list-loadtest | xargs echo|sed 's/ /|/g')" | ||
TESTS=(${TESTS//|/ }) | ||
MATRIX="{\"include\":[" | ||
curr="" | ||
for i in "${!TESTS[@]}"; do | ||
if (( i > 0 && i % 2 == 0 )); then | ||
curr+="|${TESTS[$i]}" | ||
else | ||
if [ -n "$curr" ] && (( i>1 )); then | ||
MATRIX+=",{\"test\":\"$curr\"}" | ||
elif [ -n "$curr" ]; then | ||
MATRIX+="{\"test\":\"$curr\"}" | ||
fi | ||
curr="${TESTS[$i]}" | ||
fi | ||
done | ||
MATRIX+="]}" | ||
echo "::set-output name=matrix::$MATRIX" | ||
loadtest: | ||
runs-on: ubuntu-latest | ||
needs: [setup-environment, loadtestpre] | ||
needs: [setup-environment] | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJson(needs.loadtestpre.outputs.matrix) }} | ||
matrix: ${{ fromJson(needs.setup-environment.outputs.matrix) }} | ||
env: | ||
TEST_RESULTS: testbed/tests/results/junit/results.xml | ||
steps: | ||
|