Skip to content

Replace most bash unit tests with Hatchet tests #287

Replace most bash unit tests with Hatchet tests

Replace most bash unit tests with Hatchet tests #287

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Ruby and dependencies
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: "3.4"
- name: Install shfmt
run: sudo apt-get install shfmt
- run: make lint-scripts
- run: make check-format
- run: make lint-ruby
hatchet:
name: "Hatchet (${{ matrix.stack }}, ${{ matrix.assets-base-url == 0 && 'production bucket' || 'staging bucket' }})"
runs-on: ubuntu-22.04
needs: lint
strategy:
fail-fast: false
matrix:
stack: ["heroku-20", "heroku-22", "heroku-24"]
assets-base-url: ["", "https://lang-jvm-staging2.s3.us-east-1.amazonaws.com/"]
env:
HATCHET_APP_LIMIT: 100
PARALLEL_SPLIT_TEST_PROCESSES: 8
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}
HEROKU_API_USER: ${{ secrets.HEROKU_API_USER }}
HEROKU_DISABLE_AUTOUPDATE: 1
HATCHET_BUILDPACK_BASE: https://github.com/heroku/heroku-buildpack-jvm-common
HATCHET_DEFAULT_STACK: ${{ matrix.stack }}
JVM_COMMON_BUILDPACK_TARBALL: https://api.github.com/repos/heroku/heroku-buildpack-jvm-common/tarball/${{ github.head_ref || github.ref_name }}
steps:
- uses: actions/checkout@v4
- name: Install Ruby and dependencies
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
ruby-version: "3.3"
- name: Hatchet setup
run: bundle exec hatchet ci:setup
- name: Run Hatchet integration tests
run: bundle exec parallel_split_test test/spec/
unit-tests:
name: "Unit Tests (${{ matrix.stack }})"
runs-on: ubuntu-22.04
needs: lint
container:
image: "${{ fromJson('{ \"heroku-20\": \"heroku/heroku:20\", \"heroku-22\": \"heroku/heroku:22\", \"heroku-24\": \"heroku/heroku:24\" }')[matrix.stack] }}"
options: --user root
env:
STACK: ${{ matrix.stack }}
strategy:
matrix:
stack: ["heroku-20", "heroku-22", "heroku-24"]
steps:
- uses: actions/checkout@v4
- run: test/jdbc.sh
container-test:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
# These test both the local development `make run` workflow and that `bin/report` completes successfully
# for both passing and failing builds (since `bin/report` can't easily be tested via Hatchet tests).
- name: Run buildpack using default app fixture
run: make run
#- name: Run buildpack using an app fixture that's expected to fail
# run: make run FIXTURE=spec/fixtures/failing/