-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from Scalingo/fix/8/upstream_v73
Sync with upstream v73
- Loading branch information
Showing
18 changed files
with
184 additions
and
259 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,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 |
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,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 |
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
Oops, something went wrong.