Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AMD (x86_64) and ARM (aarch64) on Heroku-24 #38

Merged
merged 10 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 75 additions & 30 deletions .github/workflows/build_ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,21 @@ jobs:
STACK: "heroku-20"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: '3.1'
- name: Install dependencies
run: bundle install
uses: actions/checkout@v4
- name: Output CHANGELOG
run: bundle exec rake "changelog[${{inputs.ruby_version}}]"
run: bin/print_changelog "${{inputs.ruby_version}}"
- name: Build Docker image
run: bundle exec rake "generate_image[$STACK]"
- name: Generate Ruby Dockerfile
run: bundle exec rake "new[${{inputs.ruby_version}},$STACK]"
run: bin/activate_docker "$STACK"
- name: Build and package Ruby runtime
run: bash "rubies/$STACK/ruby-${{inputs.ruby_version}}.sh"
- name: Upload Ruby runtime archive to S3
run: bin/build_ruby "$STACK" "${{inputs.ruby_version}}"
- name: Verify ruby executable and output rubygems version
run: bin/print_gem_version "$STACK" "${{inputs.ruby_version}}"
- name: Upload Ruby runtime archive to S3 dry run
if: (inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}" --dryrun
- name: Upload Ruby runtime archive to S3 production
if: (!inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}"
- name: Output Rubygems version
run: bundle exec rake "rubygems_version[${{inputs.ruby_version}},$STACK]"

build-and-upload-heroku-22:
if: (!startsWith(inputs.ruby_version, '3.0')) # https://bugs.ruby-lang.org/issues/18658
Expand All @@ -58,23 +53,73 @@ jobs:
STACK: "heroku-22"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: '3.1'
- name: Install dependencies
run: bundle install
uses: actions/checkout@v4
- name: Output CHANGELOG
run: bundle exec rake "changelog[${{inputs.ruby_version}}]"
run: bin/print_changelog "${{inputs.ruby_version}}"
- name: Build Docker image
run: bundle exec rake "generate_image[$STACK]"
- name: Generate Ruby Dockerfile
run: bundle exec rake "new[${{inputs.ruby_version}},$STACK]"
run: bin/activate_docker "$STACK"
- name: Build and package Ruby runtime
run: bash "rubies/$STACK/ruby-${{inputs.ruby_version}}.sh"
- name: Upload Ruby runtime archive to S3
run: bin/build_ruby "$STACK" "${{inputs.ruby_version}}"
- name: Verify ruby executable and output rubygems version
run: bin/print_gem_version "$STACK" "${{inputs.ruby_version}}"
- name: Upload Ruby runtime archive to S3 dry run
if: (inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}" --dryrun
- name: Upload Ruby runtime archive to S3 production
if: (!inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}"

build-and-upload-heroku-24-amd:
if: (!startsWith(inputs.ruby_version, '3.0')) # https://bugs.ruby-lang.org/issues/18658
runs-on: pub-hk-ubuntu-22.04-xlarge
env:
STACK: "heroku-24"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Output CHANGELOG
run: bin/print_changelog "${{inputs.ruby_version}}"
- name: Build Docker image
run: bin/activate_docker "$STACK"
- name: Build and package Ruby runtime
run: bin/build_ruby "$STACK" "${{inputs.ruby_version}}"
- name: Verify ruby executable and output rubygems version
run: bin/print_gem_version "$STACK" "${{inputs.ruby_version}}" amd64
- name: Upload Ruby runtime archive to S3 dry run
if: (inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}" --dryrun
- name: Upload Ruby runtime archive to S3 production
if: (!inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}"

build-and-upload-heroku-24-arm:
if: (!startsWith(inputs.ruby_version, '3.0')) # https://bugs.ruby-lang.org/issues/18658
runs-on: pub-hk-ubuntu-22.04-arm-large
env:
STACK: "heroku-24"
steps:
- name: Checkout
uses: actions/checkout@v4
# Docker (and other tools) are not present on the early-access runners.
# We must install them manually: https://github.com/github-early-access/arm-runners-beta
- name: Install docker
run: |
bin/setup_docker_ci

sudo usermod -aG docker $USER
sudo apt-get install acl
sudo setfacl --modify user:$USER:rw /var/run/docker.sock
- name: Output CHANGELOG
run: bin/print_changelog "${{inputs.ruby_version}}"
- name: Build Docker image
run: bin/activate_docker "$STACK"
- name: Build and package Ruby runtime
run: bin/build_ruby "$STACK" "${{inputs.ruby_version}}"
- name: Verify ruby executable and output rubygems version
run: bin/print_gem_version "$STACK" "${{inputs.ruby_version}}" arm64
- name: Upload Ruby runtime archive to S3 dry run
if: (inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}" --dryrun
- name: Upload Ruby runtime archive to S3 production
if: (!inputs.dry_run)
run: aws s3 sync ./builds "s3://${S3_BUCKET}"
- name: Output Rubygems version
run: bundle exec rake "rubygems_version[${{inputs.ruby_version}},$STACK]"
73 changes: 55 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
ruby-version: 3.2
bundler-cache: true
- name: Linting
run: bundle exec standardrb
run: bundle exec standardrb --no-fix

test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
ruby-version: '3.2'
bundler-cache: true
- name: test
run: bundle exec rspec spec
Expand All @@ -39,20 +39,57 @@ jobs:
version: ["3.1.4"]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1
with:
ruby-version: '3.1'
- name: Install dependencies
run: bundle install
uses: actions/checkout@v4
- name: Output CHANGELOG
run: bin/print_changelog "${{matrix.version}}"
- name: Build Docker image
run: bin/activate_docker "${{matrix.stack}}"
- name: Build and package Ruby runtime
run: bin/build_ruby "${{matrix.stack}}" "${{matrix.version}}"
- name: Verify ruby executable and output rubygems version
run: bin/print_gem_version "${{matrix.stack}}" "${{matrix.version}}"

integration_test-heroku-24-amd:
runs-on: pub-hk-ubuntu-22.04-xlarge
strategy:
matrix:
stack: ["heroku-24"]
version: ["3.2.3"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Output CHANGELOG
run: bin/print_changelog "${{matrix.version}}"
schneems marked this conversation as resolved.
Show resolved Hide resolved
- name: Build Docker image
run: bin/activate_docker "${{matrix.stack}}"
- name: Build and package Ruby runtime
run: bin/build_ruby "${{matrix.stack}}" "${{matrix.version}}"
- name: Verify ruby executable and output rubygems version
run: bin/print_gem_version "${{matrix.stack}}" "${{matrix.version}}" amd64

integration_test-heroku-24-arm:
runs-on: pub-hk-ubuntu-22.04-arm-large
strategy:
matrix:
stack: ["heroku-24"]
version: ["3.2.3"]
steps:
- name: Checkout
uses: actions/checkout@v4
# Docker (and other tools) are not present on the early-access runners.
# We must install them manually: https://github.com/github-early-access/arm-runners-beta
- name: Install docker
run: |
bin/setup_docker_ci

sudo usermod -aG docker $USER
sudo apt-get install acl
sudo setfacl --modify user:$USER:rw /var/run/docker.sock
- name: Output CHANGELOG
run: bundle exec rake "changelog[${{matrix.version}}]"
run: bin/print_changelog "${{matrix.version}}"
- name: Build Docker image
run: bundle exec rake "generate_image[${{matrix.stack}}]"
- name: Generate Ruby Dockerfile
run: bundle exec rake "new[${{matrix.version}},${{matrix.stack}}]"
run: bin/activate_docker "${{matrix.stack}}"
- name: Build and package Ruby runtime
run: bash "rubies/${{matrix.stack}}/ruby-${{matrix.version}}.sh"
run: bin/build_ruby "${{matrix.stack}}" "${{matrix.version}}"
- name: Verify ruby executable and output rubygems version
run: bundle exec rake "rubygems_version[${{matrix.version}},${{matrix.stack}}]"
run: bin/print_gem_version "${{matrix.stack}}" "${{matrix.version}}" arm64
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ vendor/
.DS_Store

test/fixtures/repos/*
Dockerfile
5 changes: 0 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
source "https://rubygems.org"

gem "rake"
gem "aws-sdk"
gem "heroku_hatchet"
gem "webrick"
gem "nokogiri"
gem "rspec"
gem "standard"
Loading