From 8187deaededd37a803a6aa62f19e8b21a8b291d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Miri=C4=87?= Date: Fri, 25 Sep 2020 12:01:54 +0200 Subject: [PATCH] WIP test release --- .github/workflows/all.yml | 256 ++++++++++++++++----------------- build-release.sh | 4 +- release notes/v0.29.0-test2.md | 5 + 3 files changed, 136 insertions(+), 129 deletions(-) create mode 100644 release notes/v0.29.0-test2.md diff --git a/.github/workflows/all.yml b/.github/workflows/all.yml index d6e20e1758c..a176369a0fc 100644 --- a/.github/workflows/all.yml +++ b/.github/workflows/all.yml @@ -19,135 +19,135 @@ env: GODEBUG: netdns=go+1 jobs: - deps: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: 1.14.x - - name: Check dependencies - run: | - go version - test -z "$(go mod vendor && git status --porcelain)" - go mod verify + # deps: + # runs-on: ubuntu-latest + # defaults: + # run: + # shell: bash + # steps: + # - name: Checkout code + # uses: actions/checkout@v2 + # - name: Install Go + # uses: actions/setup-go@v2 + # with: + # go-version: 1.14.x + # - name: Check dependencies + # run: | + # go version + # test -z "$(go mod vendor && git status --porcelain)" + # go mod verify - lint: - runs-on: ubuntu-latest - defaults: - run: - shell: bash - env: - GOLANGCI_VERSION: v1.31 - GO111MODULE: 'on' - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Lint - # Why is `go mod vendor` needed here!? If it's not run then - # golangci-lint fails because of inconsistent vendoring... - run: | - go get github.com/golangci/golangci-lint/cmd/golangci-lint@$GOLANGCI_VERSION - BASEREV=$(git merge-base HEAD origin/master) - echo "Base revision: $BASEREV" - export PATH="$HOME/go/bin:$PATH" - go mod vendor - golangci-lint run --out-format=tab --new-from-rev "$BASEREV" ./... + # lint: + # runs-on: ubuntu-latest + # defaults: + # run: + # shell: bash + # env: + # GOLANGCI_VERSION: v1.31 + # GO111MODULE: 'on' + # steps: + # - name: Checkout code + # uses: actions/checkout@v2 + # with: + # fetch-depth: 0 + # - name: Lint + # # Why is `go mod vendor` needed here!? If it's not run then + # # golangci-lint fails because of inconsistent vendoring... + # run: | + # go get github.com/golangci/golangci-lint/cmd/golangci-lint@$GOLANGCI_VERSION + # BASEREV=$(git merge-base HEAD origin/master) + # echo "Base revision: $BASEREV" + # export PATH="$HOME/go/bin:$PATH" + # go mod vendor + # golangci-lint run --out-format=tab --new-from-rev "$BASEREV" ./... - test: - strategy: - matrix: - go-version: [1.14.x, 1.15.x] - platform: [ubuntu-latest, windows-latest] - runs-on: ${{ matrix.platform }} - defaults: - run: - shell: bash - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Install Go - uses: actions/setup-go@v2 - with: - go-version: ${{ matrix.go-version }} - - name: Run tests with code coverage - run: | - go version - export GOMAXPROCS=2 - export PATH=$GOPATH/bin:$PATH - echo "mode: set" > coverage.txt - for pkg in $(go list ./... | grep -v vendor); do - list=$(go list -test -f '{{ join .Deps "\n"}}' $pkg | grep github.com/loadimpact/k6 | grep -v vendor || true) - if [ -n "$list" ]; then - list=$(echo "$list" | cut -f1 -d ' ' | sort -u | paste -sd, -) - fi + # test: + # strategy: + # matrix: + # go-version: [1.14.x, 1.15.x] + # platform: [ubuntu-latest, windows-latest] + # runs-on: ${{ matrix.platform }} + # defaults: + # run: + # shell: bash + # steps: + # - name: Checkout code + # uses: actions/checkout@v2 + # - name: Install Go + # uses: actions/setup-go@v2 + # with: + # go-version: ${{ matrix.go-version }} + # - name: Run tests with code coverage + # run: | + # go version + # export GOMAXPROCS=2 + # export PATH=$GOPATH/bin:$PATH + # echo "mode: set" > coverage.txt + # for pkg in $(go list ./... | grep -v vendor); do + # list=$(go list -test -f '{{ join .Deps "\n"}}' $pkg | grep github.com/loadimpact/k6 | grep -v vendor || true) + # if [ -n "$list" ]; then + # list=$(echo "$list" | cut -f1 -d ' ' | sort -u | paste -sd, -) + # fi - go test -v -race -timeout 800s --coverpkg="$list" -coverprofile=$(echo $pkg | tr / -).coverage $pkg - done - grep -h -v "^mode:" *.coverage >> coverage.txt - rm -f *.coverage - bash <(curl --fail -s https://codecov.io/bash) - go tool cover -html=coverage.txt -o coverage.html - - name: Upload coverage report - uses: actions/upload-artifact@v2 - with: - name: test-coverage-report - path: coverage.html + # go test -v -race -timeout 800s --coverpkg="$list" -coverprofile=$(echo $pkg | tr / -).coverage $pkg + # done + # grep -h -v "^mode:" *.coverage >> coverage.txt + # rm -f *.coverage + # bash <(curl --fail -s https://codecov.io/bash) + # go tool cover -html=coverage.txt -o coverage.html + # - name: Upload coverage report + # uses: actions/upload-artifact@v2 + # with: + # name: test-coverage-report + # path: coverage.html - docker: - runs-on: ubuntu-latest - needs: [lint, test] - steps: - - name: Checkout code - uses: actions/checkout@v2 - - name: Build - run: docker build -t $DOCKER_IMAGE_ID . - - name: Check - run: | - docker run $DOCKER_IMAGE_ID version - docker run $DOCKER_IMAGE_ID --help - docker run $DOCKER_IMAGE_ID help - docker run $DOCKER_IMAGE_ID run --help - docker run $DOCKER_IMAGE_ID inspect --help - docker run $DOCKER_IMAGE_ID status --help - docker run $DOCKER_IMAGE_ID stats --help - docker run $DOCKER_IMAGE_ID scale --help - docker run $DOCKER_IMAGE_ID pause --help - docker run $DOCKER_IMAGE_ID resume --help - - name: Publish - if: github.event_name != 'pull_request' - run: | - echo "REF=${{ github.ref }}" - echo "DOCKER_IMAGE_ID=$DOCKER_IMAGE_ID" - # - # Log into registry - echo "${{ secrets.DOCKER_PASS }}" | docker login -u "${{ secrets.DOCKER_USER }}" --password-stdin - # Strip git ref prefix from version - VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') - # Strip "v" prefix from tag name - [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo "$VERSION" | sed -e 's/^v//') - echo "VERSION=$VERSION" - docker tag "$DOCKER_IMAGE_ID" "$DOCKER_IMAGE_ID:$VERSION" - docker push "$DOCKER_IMAGE_ID:$VERSION" - # We also want to tag the latest stable version as latest - if [[ "$VERSION" != "master" ]] && [[ ! "$VERSION" =~ (RC|rc) ]]; then - docker tag "$DOCKER_IMAGE_ID" "$DOCKER_IMAGE_ID:latest" - docker push "$DOCKER_IMAGE_ID:latest" - fi + # docker: + # runs-on: ubuntu-latest + # needs: [lint, test] + # steps: + # - name: Checkout code + # uses: actions/checkout@v2 + # - name: Build + # run: docker build -t $DOCKER_IMAGE_ID . + # - name: Check + # run: | + # docker run $DOCKER_IMAGE_ID version + # docker run $DOCKER_IMAGE_ID --help + # docker run $DOCKER_IMAGE_ID help + # docker run $DOCKER_IMAGE_ID run --help + # docker run $DOCKER_IMAGE_ID inspect --help + # docker run $DOCKER_IMAGE_ID status --help + # docker run $DOCKER_IMAGE_ID stats --help + # docker run $DOCKER_IMAGE_ID scale --help + # docker run $DOCKER_IMAGE_ID pause --help + # docker run $DOCKER_IMAGE_ID resume --help + # - name: Publish + # if: github.event_name != 'pull_request' + # run: | + # echo "REF=${{ github.ref }}" + # echo "DOCKER_IMAGE_ID=$DOCKER_IMAGE_ID" + # # + # # Log into registry + # echo "${{ secrets.DOCKER_PASS }}" | docker login -u "${{ secrets.DOCKER_USER }}" --password-stdin + # # Strip git ref prefix from version + # VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') + # # Strip "v" prefix from tag name + # [[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo "$VERSION" | sed -e 's/^v//') + # echo "VERSION=$VERSION" + # docker tag "$DOCKER_IMAGE_ID" "$DOCKER_IMAGE_ID:$VERSION" + # docker push "$DOCKER_IMAGE_ID:$VERSION" + # # We also want to tag the latest stable version as latest + # if [[ "$VERSION" != "master" ]] && [[ ! "$VERSION" =~ (RC|rc) ]]; then + # docker tag "$DOCKER_IMAGE_ID" "$DOCKER_IMAGE_ID:latest" + # docker push "$DOCKER_IMAGE_ID:latest" + # fi release: runs-on: ubuntu-latest defaults: run: shell: bash - needs: [lint, test] + # needs: [lint, test] if: startsWith(github.ref, 'refs/tags/v') steps: - name: Checkout code @@ -157,23 +157,23 @@ jobs: with: go-version: 1.14.x - name: Install package builders + # Needed so that `go get` doesn't try to install glide as as a k6 + # dependency, which would fail if run from the k6 directory because of + # Go modules. + working-directory: /tmp run: | - pushd . - tmpdir=$(mktemp -d) - cd "$tmpdir" + gopath="$(go env GOPATH)" go get github.com/Masterminds/glide go get -d github.com/mh-cbon/go-bin-deb \ - && (cd $GOPATH/src/github.com/mh-cbon/go-bin-deb \ + && (cd "$gopath/src/github.com/mh-cbon/go-bin-deb" \ && glide install \ && go install) go get -d github.com/mh-cbon/go-bin-rpm \ - && (cd $GOPATH/src/github.com/mh-cbon/go-bin-rpm \ + && (cd "$gopath/src/github.com/mh-cbon/go-bin-rpm" \ && glide install \ && go install) - apt-get update -y - apt-get install -y fakeroot rpm - popd - rm -rf "$tmpdir" + sudo apt-get update -y + sudo apt-get install -y fakeroot rpm - name: Build run: | go version diff --git a/build-release.sh b/build-release.sh index e266ef84d78..c7ef7eae1d3 100755 --- a/build-release.sh +++ b/build-release.sh @@ -42,7 +42,8 @@ package() { deb|rpm) # The go-bin-* tools expect the binary in /tmp/ [ ! -r /tmp/k6 ] && cp "dist/${NAME}/k6" /tmp/k6 - "go-bin-${FMT}" generate --file "packaging/${FMT}.json" -a amd64 --version $VERSION -o "dist/k6-v${VERSION}-amd64.${FMT}" + "go-bin-${FMT}" generate --file "packaging/${FMT}.json" -a amd64 \ + --version "${VERSION#v}" -o "dist/k6-${VERSION}-amd64.${FMT}" ;; tgz) tar -C "${OUT_DIR}" -zcf "${OUT_DIR}/${NAME}.tar.gz" "$NAME" @@ -75,6 +76,7 @@ checksum() { cleanup() { find "$OUT_DIR" -mindepth 1 -maxdepth 1 -type d -exec rm -rf {} \; + rm -f /tmp/k6 echo "--- Cleaned ${OUT_DIR}" } trap cleanup EXIT diff --git a/release notes/v0.29.0-test2.md b/release notes/v0.29.0-test2.md new file mode 100644 index 00000000000..e4d630de960 --- /dev/null +++ b/release notes/v0.29.0-test2.md @@ -0,0 +1,5 @@ +k6 v0.29.0 is here! :tada: + +## New features and enhancements! + +- [k6](https://github.com/loadimpact/k6/) ...