Skip to content

WIP

WIP #258

Workflow file for this run

name: CI
on:
- push
- pull_request
jobs:
shellcheck:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run ShellCheck
run: shellcheck *.sh -x
lint:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Rust toolchain
# Most of the time this will be a no-op, since GitHub releases new images every week
# which include the latest stable release of Rust, Rustup, Clippy and rustfmt.
run: rustup update
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Clippy
# Using --all-targets so tests are checked and --deny to fail on warnings.
# Not using --locked here and below since Cargo.lock is in .gitignore.
run: cargo clippy --all-targets --all-features -- --deny warnings
- name: rustfmt
run: cargo fmt -- --check
- name: Check docs
# Using RUSTDOCFLAGS until `cargo doc --check` is stabilised:
# https://github.com/rust-lang/cargo/issues/10025
run: RUSTDOCFLAGS="-D warnings" cargo doc --all-features --document-private-items --no-deps
unit-test:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Rust toolchain
run: rustup update
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Run unit tests
run: cargo test --all-features
ruby_integration_test:
runs-on: ${{ matrix.arch == 'arm64' && 'pub-hk-ubuntu-24.04-arm-medium' || 'ubuntu-24.04' }}
strategy:
matrix:
base_image: ["heroku-20", "heroku-22", "heroku-24"]
version: ["3.2.3"]
arch: ["arm64", "amd64"]
exclude:
- base_image: "heroku-20"
arch: "arm64"
- base_image: "heroku-22"
arch: "arm64"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Rust toolchain
run: rustup update
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Cargo build (to make test logs shorter)
run: cargo build
- name: Output CHANGELOG
run: cargo run --bin ruby_changelog -- --version "${{matrix.version}}"
- name: Build Ruby
run: cargo run --bin ruby_build -- --version ${{matrix.version}} --base-image ${{matrix.base_image}} --arch ${{matrix.arch}}
- name: Check Ruby
run: cargo run --bin ruby_check -- --version ${{matrix.version}} --base-image ${{matrix.base_image}} --arch ${{matrix.arch}}
jruby_integration_test:
runs-on: ${{ matrix.arch == 'arm64' && 'pub-hk-ubuntu-24.04-arm-medium' || 'ubuntu-24.04' }}
strategy:
matrix:
base_image: ["heroku-20", "heroku-22", "heroku-24"]
version: ["9.4.7.0"]
arch: ["arm64", "amd64"]
exclude:
- base_image: "heroku-20"
arch: "arm64"
- base_image: "heroku-22"
arch: "arm64"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Rust toolchain
run: rustup update
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Cargo build (to make test logs shorter)
run: cargo build
- name: Output CHANGELOG
run: cargo run --bin jruby_changelog -- --version "${{matrix.version}}"
- name: Build JRuby
run: cargo run --bin jruby_build -- --version ${{matrix.version}} --base-image ${{matrix.base_image}}
- name: Check JRuby
run: cargo run --bin jruby_check -- --version ${{matrix.version}} --base-image ${{matrix.base_image}} --arch ${{matrix.arch}}
check_inventory_urls:
runs-on: ubuntu-24.04
if: (!contains(github.event.pull_request.labels.*.name, 'skip inventory check'))
strategy:
matrix:
inventory: ["jruby_inventory.toml", "ruby_inventory.toml"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Grab prior commits
run: |
set -eu
set pipefail
git fetch origin ${{ github.base_ref }} --depth 1 && \
git diff --unified=0 remotes/origin/${{ github.base_ref }} ${{matrix.inventory}} | grep '^+' | grep -v '^+++' | cut -c2- > check_inventory.toml
- name: Check manifest URLs
run: cargo run --bin inventory_check -- check_inventory.toml
test-dependent-job:
runs-on: ubuntu-24.04
strategy:
matrix:
arch: ["amd64", "arm64"]
base_image: ["heroku-20", "heroku-22", "heroku-24"]
steps:
- name: Store inventory
id: store_inventory
run: |
echo "${{ matrix.base_image }}${{ matrix.arch }}=" > $GITHUB_OUTPUT
cat "${{ matrix.base_image }}${{ matrix.arch }}-inventory.toml | jq -r . >> $GITHUB_OUTPUT"
after-test-dependent-job:
runs-on: ubuntu-24.04
needs: test-dependent-job
steps:
- name: Output GITHUB_OUTPUT
run: echo ${{needs.test-dependent-job.outputs}}
- name: Combine results
run: |
echo "Combining results..."
for key in $(jq -r 'keys[]' <<< "${{ toJson(needs.test-dependent-job.outputs) }}"); do
value=$(jq -r --arg key "$key" '.[$key]' <<< "${{ toJson(needs.test-dependent-job.outputs) }}")
echo "$value" >> combined.txt
echo "" >> combined.txt
done