From 86d80af331be4f676a3b886d062070564c274e64 Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Wed, 19 Jun 2024 05:15:11 +0000 Subject: [PATCH] Bump pipeline from 1.39.0 to 1.39.0 Bumps pipeline from 1.39.0 to 1.39.0. Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .github/dependabot.yml | 11 +++++ .github/workflows/pb-tests.yml | 60 +++++++++++++++++++++---- .github/workflows/pb-update-go.yml | 72 ++++++++++++++++++++++++++++++ .gitignore | 3 +- 4 files changed, 135 insertions(+), 11 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/pb-update-go.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..2adccd4b --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: + - package-ecosystem: gomod + directory: / + schedule: + interval: daily + ignore: + - dependency-name: github.com/onsi/gomega + labels: + - semver:patch + - type:dependency-upgrade diff --git a/.github/workflows/pb-tests.yml b/.github/workflows/pb-tests.yml index f3a86edd..d1d82bde 100644 --- a/.github/workflows/pb-tests.yml +++ b/.github/workflows/pb-tests.yml @@ -177,16 +177,58 @@ jobs: fi env: FORMAT: image - PACKAGES: test - TTL_SH_PUBLISH: "false" - VERSION: ${{ steps.version.outputs.version }} - - name: Set up JDK - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'liberica' + PACKAGES: ttl.sh/test-${{ steps.version.outputs.version }} + TTL_SH_PUBLISH: "true" + VERSION: 1h - name: Run Integration Tests - run: "BP_UNDER_TEST=${PACKAGE}:${VERSION} make integration" + run: | + #!/usr/bin/env bash + + set -euo pipefail + + go test ./integration/... -run Integration env: PACKAGE: test VERSION: ${{ steps.version.outputs.version }} + unit: + name: Unit Test + runs-on: + - ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/cache@v4 + with: + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + path: ${{ env.HOME }}/go/pkg/mod + restore-keys: ${{ runner.os }}-go- + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + - name: Install richgo + run: | + #!/usr/bin/env bash + + set -euo pipefail + + echo "Installing richgo ${RICHGO_VERSION}" + + mkdir -p "${HOME}"/bin + echo "${HOME}/bin" >> "${GITHUB_PATH}" + + curl \ + --location \ + --show-error \ + --silent \ + "https://github.com/kyoh86/richgo/releases/download/v${RICHGO_VERSION}/richgo_${RICHGO_VERSION}_linux_amd64.tar.gz" \ + | tar -C "${HOME}"/bin -xz richgo + env: + RICHGO_VERSION: 0.3.10 + - name: Run Tests + run: | + #!/usr/bin/env bash + + set -euo pipefail + + richgo test ./... -run Unit + env: + RICHGO_FORCE_COLOR: "1" diff --git a/.github/workflows/pb-update-go.yml b/.github/workflows/pb-update-go.yml new file mode 100644 index 00000000..eb330af2 --- /dev/null +++ b/.github/workflows/pb-update-go.yml @@ -0,0 +1,72 @@ +name: Update Go +"on": + schedule: + - cron: 42 2 * * 1 + workflow_dispatch: {} +jobs: + update: + name: Update Go + runs-on: + - ubuntu-latest + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + - uses: actions/checkout@v4 + - name: Update Go Version & Modules + id: update-go + run: | + #!/usr/bin/env bash + + set -euo pipefail + + if [ -z "${GO_VERSION:-}" ]; then + echo "No go version set" + exit 1 + fi + + OLD_GO_VERSION=$(grep -P '^go \d\.\d+' go.mod | cut -d ' ' -f 2) + + go mod edit -go="$GO_VERSION" + go mod tidy + go get -u -t ./... + go mod tidy + + git add go.mod go.sum + git checkout -- . + + if [ "$OLD_GO_VERSION" == "$GO_VERSION" ]; then + COMMIT_TITLE="Bump Go Modules" + COMMIT_BODY="Bumps Go modules used by the project. See the commit for details on what modules were updated." + COMMIT_SEMVER="semver:patch" + else + COMMIT_TITLE="Bump Go from ${OLD_GO_VERSION} to ${GO_VERSION}" + COMMIT_BODY="Bumps Go from ${OLD_GO_VERSION} to ${GO_VERSION} and update Go modules used by the project. See the commit for details on what modules were updated." + COMMIT_SEMVER="semver:minor" + fi + + echo "commit-title=${COMMIT_TITLE}" >> "$GITHUB_OUTPUT" + echo "commit-body=${COMMIT_BODY}" >> "$GITHUB_OUTPUT" + echo "commit-semver=${COMMIT_SEMVER}" >> "$GITHUB_OUTPUT" + env: + GO_VERSION: "1.22" + - uses: peter-evans/create-pull-request@v6 + with: + author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> + body: |- + ${{ steps.update-go.outputs.commit-body }} + +
+ Release Notes + ${{ steps.pipeline.outputs.release-notes }} +
+ branch: update/go + commit-message: |- + ${{ steps.update-go.outputs.commit-title }} + + ${{ steps.update-go.outputs.commit-body }} + delete-branch: true + labels: ${{ steps.update-go.outputs.commit-semver }}, type:task + signoff: true + title: ${{ steps.update-go.outputs.commit-title }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 6e9f2d5e..2f65ee41 100755 --- a/.gitignore +++ b/.gitignore @@ -17,5 +17,4 @@ linux/ dependencies/ package/ scratch/ -target -*.cnb +