1
0
Fork 0
mirror of https://github.com/rubyjs/mini_racer synced 2023-03-27 23:21:28 -04:00
mini_racer/.github/workflows/ci.yml
Gerhard Schlager 3d110768ee
Fix GitHub Actions and add tests for mutable strings (#256)
* Fix GitHub Actions

* Disable tests with `musl` for arm64 because there's no `libv8-node` gem for aarch64-linux-musl at the moment
* Fix tests on older Ruby versions by running `gem update --system`
* Removes macOS 10.15 (it will be unsupported by 2022-08-30 anyway)
* Adds macOS 12 to the matrix
* Run TruffleRuby job on macOS as well
* Use `ruby/setup-ruby` action where possible and update `actions/checkout` to v3
* Run tests for pull requests

* Raise sleep duration in tests to fix CI failures on macOS

* Add tests for mutable string arguments and return values
2022-07-22 08:45:20 +10:00

124 lines
3.5 KiB
YAML

name: Tests
on:
pull_request:
push:
branches:
- master
jobs:
test-truffleruby:
strategy:
fail-fast: false
matrix:
os:
- "macos-11"
- "macos-12"
- "ubuntu-20.04"
ruby:
- "truffleruby+graalvm-head"
name: ${{ matrix.os }} - ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}
env:
TRUFFLERUBYOPT: "--jvm --polyglot"
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Install GraalVM JS component
run: gu install js
- name: Compile
run: bundle exec rake compile
- name: Test
run: bundle exec rake test
test-darwin:
strategy:
fail-fast: false
matrix:
os:
- "macos-11"
- "macos-12"
ruby:
- "ruby-2.6"
- "ruby-2.7"
- "ruby-3.0"
- "ruby-3.1"
name: ${{ matrix.os }} - ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Compile
run: bundle exec rake compile
- name: Test
run: bundle exec rake test
test-linux:
strategy:
fail-fast: false
matrix:
ruby:
- "2.6"
- "2.7"
- "3.0"
- "3.1"
platform:
- "amd64"
- "arm64"
libc:
- "gnu"
- "musl"
exclude:
# there's no libv8-node (v16) for aarch64-linux-musl at the moment
- platform: "arm64"
libc: "musl"
name: linux-${{ matrix.platform }} - ruby-${{ matrix.ruby }} - ${{ matrix.libc }}
runs-on: ubuntu-20.04
steps:
- name: Enable ${{ matrix.platform }} platform
id: qemu
if: ${{ matrix.platform != 'amd64' }}
run: |
docker run --privileged --rm tonistiigi/binfmt:latest --install ${{ matrix.platform }} | tee platforms.json
echo "::set-output name=platforms::$(cat platforms.json)"
- name: Start container
id: container
run: |
case ${{ matrix.libc }} in
gnu)
echo 'ruby:${{ matrix.ruby }}'
;;
musl)
echo 'ruby:${{ matrix.ruby }}-alpine'
;;
esac > container_image
echo "::set-output name=image::$(cat container_image)"
docker run --rm -d -v "${PWD}":"${PWD}" -w "${PWD}" --platform linux/${{ matrix.platform }} $(cat container_image) /bin/sleep 64d | tee container_id
docker exec -w "${PWD}" $(cat container_id) uname -a
echo "::set-output name=id::$(cat container_id)"
- name: Install Alpine system dependencies
if: ${{ matrix.libc == 'musl' }}
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} apk add --no-cache build-base bash git
- name: Checkout
uses: actions/checkout@v3
- name: Update Rubygems
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} gem update --system
- name: Bundle
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle install
- name: Compile
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle exec rake compile
- name: Test
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} bundle exec rake test