Skip to content

Commit

Permalink
Merge pull request #19 from Scalingo/fix/8/upstream_v73
Browse files Browse the repository at this point in the history
Sync with upstream v73
  • Loading branch information
Frzk authored Oct 30, 2023
2 parents 03ed58d + c0fac47 commit 0df8750
Show file tree
Hide file tree
Showing 18 changed files with 184 additions and 259 deletions.
95 changes: 0 additions & 95 deletions .circleci/config.yml

This file was deleted.

9 changes: 8 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ updates:
- package-ecosystem: "bundler"
directory: "/"
schedule:
interval: "weekly"
interval: "monthly"
labels:
- "dependencies"
- "skip changelog"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
labels:
- "dependencies"
- "skip changelog"
22 changes: 13 additions & 9 deletions .github/workflows/check_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,21 @@ name: Check Changelog

on:
pull_request:
types: [opened, reopened, edited, synchronize, labeled]
types: [opened, reopened, labeled, unlabeled, synchronize]

permissions:
contents: read

jobs:
check:
runs-on: ubuntu-latest
check-changelog:
runs-on: ubuntu-22.04
if: |
!contains(github.event.pull_request.body, '[skip changelog]') &&
!contains(github.event.pull_request.body, '[changelog skip]') &&
!contains(github.event.pull_request.body, '[skip ci]') &&
!contains(github.event.pull_request.labels.*.name, 'skip changelog')
!contains(github.event.pull_request.labels.*.name, 'skip changelog') &&
!contains(github.event.pull_request.labels.*.name, 'dependencies')
steps:
- uses: actions/checkout@v1
- name: Checkout
uses: actions/checkout@v3
- name: Check that CHANGELOG is touched
run: git diff remotes/origin/${{ github.base_ref }} --name-only | grep CHANGELOG.md
run: |
git fetch origin ${{ github.base_ref }} --depth 1 && \
git diff remotes/origin/${{ github.base_ref }} --name-only | grep CHANGELOG.md
96 changes: 96 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: CI

on:
push:
branches:
- main
pull_request:

permissions:
contents: read

jobs:
hatchet:
name: "Hatchet (${{ matrix.stack }})"
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
stack: ["heroku-20", "heroku-22"]
env:
HATCHET_APP_LIMIT: 100
HATCHET_EXPENSIVE_MODE: 1
PARALLEL_SPLIT_TEST_PROCESSES: 8
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_API_USER: ${{ secrets.HEROKU_API_USER }}
HEROKU_DISABLE_AUTOUPDATE: 1
# TODO: Remove once Hatchet supports GitHub Actions natively:
# https://github.com/heroku/hatchet/pull/189
HATCHET_BUILDPACK_BRANCH: ${{ github.head_ref || github.ref_name }}
HATCHET_BUILDPACK_BASE: https://github.com/heroku/heroku-buildpack-java
# Default stack for all Heroku apps created by Hatchet
DEFAULT_APP_STACK: ${{ matrix.stack }}
steps:
- uses: actions/checkout@v3
- name: Install Ruby and dependencies
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: "2.7"
- name: Hatchet setup
run: bundle exec hatchet ci:setup
- name: Run Hatchet integration tests
run: bundle exec parallel_split_test test/spec/

buildpack-testrunner:
runs-on: ubuntu-22.04
env:
SHUNIT_HOME: /tmp/shunit2-2.1.6
# Note the missing STACK environment variable here. This works since there is a default value in the buildpack
# source. I ported this as-is from the Travis config. Given we're trying to get rid of testrunner entirely,
# it will stay like this. If we, for some reason, decide to keep testrunner, we should look into a fixed STACK env var.
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: zulu
java-version: 8
- name: Download and unpack shunit 2.1.6
run: curl -sSf --retry 3 --retry-connrefused --connect-timeout 5 https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/shunit2/shunit2-2.1.6.tgz | tar xz -C /tmp/
- name: Clone heroku-buildpack-testrunner
run: git clone https://github.com/heroku/heroku-buildpack-testrunner.git /tmp/testrunner
- name: Apply heroku-buildpack-testrunner patches to enforce bash shell
run: |
cd /tmp/testrunner
git apply <<'EOF'
diff --git a/bin/run b/bin/run
index 0d5b790..a0ff25c 100755
--- a/bin/run
+++ b/bin/run
@@ -101,7 +101,7 @@ for bp in ${@}; do
suite_start_time="$(date +%s)"
echo " TEST SUITE: $(basename ${f})"
- ${SHUNIT_HOME?"'SHUNIT_HOME' environment variable must be set"}/src/shunit2 ${f} | indent
+ /bin/bash ${SHUNIT_HOME?"'SHUNIT_HOME' environment variable must be set"}/src/shunit2 ${f} | indent
exit_code=$(max ${exit_code} ${PIPESTATUS[0]})
suite_end_time="$(date +%s)"
EOF
- name: Execute buildpack-testrunner
run: /tmp/testrunner/bin/run .

unit-tests:
name: "Unit Tests (${{ matrix.stack }})"
runs-on: ubuntu-22.04
container:
image: "${{ fromJson('{ \"heroku-20\": \"heroku/heroku:20\", \"heroku-22\": \"heroku/heroku:22\" }')[matrix.stack] }}"
env:
STACK: ${{ matrix.stack }}
strategy:
matrix:
stack: ["heroku-20", "heroku-22"]
steps:
- uses: actions/checkout@v3
- run: test/unit
31 changes: 31 additions & 0 deletions .github/workflows/hatchet_app_cleaner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Hatchet app cleaner

on:
schedule:
# Daily at 6am UTC.
- cron: "0 6 * * *"
# Allow the workflow to be manually triggered too.
workflow_dispatch:

permissions:
contents: read

jobs:
hatchet-app-cleaner:
runs-on: ubuntu-latest
env:
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_API_USER: ${{ secrets.HEROKU_API_USER }}
HEROKU_DISABLE_AUTOUPDATE: 1
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Ruby and dependencies
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: "2.7"
- name: Run Hatchet destroy
# Only apps older than 10 minutes are destroyed, to ensure that any
# in progress CI runs are not interrupted.
run: bundle exec hatchet destroy --older-than 10
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## main

## v73

* Remove heroku-18 support ([#204](https://github.com/heroku/heroku-buildpack-java/pull/204))
* Upgrade default Maven version to `3.9.4`. ([#207](https://github.com/heroku/heroku-buildpack-java/pull/207))

## v72

* Adjust curl retry and connection timeout handling
Expand Down
20 changes: 10 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ GEM
excon (>= 0.47.0)
multi_json
erubis (2.7.0)
excon (0.84.0)
excon (0.99.0)
heroics (0.1.2)
erubis (~> 2.0)
excon
moneta
multi_json (>= 1.9.2)
webrick
heroku_hatchet (7.3.4)
heroku_hatchet (8.0.2)
excon (~> 0)
platform-api (~> 3)
rrrretry (~> 1)
Expand All @@ -26,23 +26,23 @@ GEM
parallel_split_test (0.10.0)
parallel (>= 0.5.13)
rspec-core (>= 3.9.0)
platform-api (3.3.0)
platform-api (3.5.0)
heroics (~> 0.1.1)
moneta (~> 1.0.0)
rate_throttle_client (~> 0.1.0)
rate_throttle_client (0.1.2)
rrrretry (1.0.0)
rspec-core (3.11.0)
rspec-support (~> 3.11.0)
rspec-expectations (3.11.1)
rspec-core (3.12.0)
rspec-support (~> 3.12.0)
rspec-expectations (3.12.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.11.0)
rspec-support (~> 3.12.0)
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.11.1)
thor (1.1.0)
rspec-support (3.12.0)
thor (1.2.1)
threaded (0.0.4)
webrick (1.7.0)
webrick (1.8.1)

PLATFORMS
ruby
Expand Down
21 changes: 1 addition & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![java](https://cloud.githubusercontent.com/assets/871315/20325947/f3544014-ab43-11e6-9c51-8240ce161939.png)

This is the official [Scalingo buildpack](https://doc.scalingo.com/buildpacks) for Java apps.
It uses Maven 3.6.2 to build your application and OpenJDK 8 to run it. However, the JDK version can be configured as described below.
It uses Maven 3.9.4 to build your application and OpenJDK 8 to run it. However, the JDK version can be configured as described below.

## How it works

Expand Down Expand Up @@ -119,25 +119,6 @@ and then:

and you'll see the `.m2` and `.maven` directories are now present in your slug.

## Run Tests Locally

Tests can be run and debugged locally by using the [Circle CI CLI](https://circleci.com/docs/2.0/local-cli/).

For example, to run [Hatchet](https://github.com/heroku/hatchet) tests on `heroku-18` run:

```
$ circleci local execute --job hatchet-heroku-18 \
--env HEROKU_API_USER=$(heroku whoami) \
--env HEROKU_API_KEY=$(heroku auth:token)
```

Available jobs are defined in [.circleci/config.yml](.circleci/config.yml).

### Costs

This command uses the credentials from your local `heroku` configuration. This means your account will be billed for any
cost these tests incur. Proceed with caution.

License
-------

Expand Down
5 changes: 1 addition & 4 deletions buildpack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,9 @@ name = "Java"
"etc/",
"spec/",
"test/",
"vendor/",
".gitignore",
".github/",
".travis.yml",
"circle.yml",
"hatchet.json",
"Gemfile",
"Gemfile.lock"
]
]
Loading

0 comments on commit 0df8750

Please sign in to comment.