Skip to content

Add GitHub sponsor button #614

Add GitHub sponsor button

Add GitHub sponsor button #614

Workflow file for this run

name: re2 Tests
concurrency:
group: "${{ github.workflow }}-${{ github.sha }}"
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
env:
RUBYOPT: "--enable-frozen-string-literal --debug-frozen-string-literal"
jobs:
build-cruby-gem:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ports/archives
key: archives-ubuntu-${{ hashFiles('dependencies.yml') }}
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.3"
bundler-cache: true
- run: bundle exec rake gem
- uses: actions/upload-artifact@v4
with:
name: cruby-gem
path: pkg/*.gem
precompile-aarch64-linux:
uses: ./.github/workflows/precompile-gem.yml
with:
platform: aarch64-linux
precompile-arm-linux:
uses: ./.github/workflows/precompile-gem.yml
with:
platform: arm-linux
precompile-x86-linux:
uses: ./.github/workflows/precompile-gem.yml
with:
platform: x86-linux
precompile-x86_64-linux:
uses: ./.github/workflows/precompile-gem.yml
with:
platform: x86_64-linux
precompile-arm64-darwin:
uses: ./.github/workflows/precompile-gem.yml
with:
platform: arm64-darwin
precompile-x86_64-darwin:
uses: ./.github/workflows/precompile-gem.yml
with:
platform: x86_64-darwin
precompile-x64-mingw-ucrt:
uses: ./.github/workflows/precompile-gem.yml
with:
platform: x64-mingw-ucrt
precompile-x64-mingw32:
uses: ./.github/workflows/precompile-gem.yml
with:
platform: x64-mingw32
precompile-x86-mingw32:
uses: ./.github/workflows/precompile-gem.yml
with:
platform: x86-mingw32
test-re2-abi:
needs: "build-cruby-gem"
runs-on: ubuntu-22.04
strategy:
matrix:
ruby: ["3.3", "2.6"] # oldest and newest
libre2:
- version: "20150501"
soname: 0
- version: "20200302"
soname: 1
- version: "20200303"
soname: 6
- version: "20200501"
soname: 7
- version: "20200706"
soname: 8
- version: "20201101"
soname: 9
- version: "20221201"
soname: 10
- version: "20230701"
soname: 11
steps:
- uses: actions/checkout@v4
- name: Remove any existing libre2 installation
run: sudo apt-get remove -y libre2-dev libre2-9
- name: Download and install specific release of libre2
run: |
curl -Lo libre2-dev.deb https://github.com/mudge/re2-ci/releases/download/v22.04/libre2-dev_${{ matrix.libre2.version }}_amd64.deb
sudo apt -f install ./libre2-dev.deb
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-gem
path: pkg
- run: ./scripts/test-gem-install --enable-system-libraries
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle
test-ubuntu:
needs: "build-cruby-gem"
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
sys: ["enable", "disable"]
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: ${{ matrix.ruby }}
apt-get: libre2-dev
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-gem
path: pkg
- run: ./scripts/test-gem-install --${{ matrix.sys }}-system-libraries
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle
test-macos:
needs: "build-cruby-gem"
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3", "3.4"]
sys: ["enable", "disable"]
runs-on: "macos-13"
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: ${{ matrix.ruby }}
brew: re2
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-gem
path: pkg
- run: ./scripts/test-gem-install --${{ matrix.sys }}-system-libraries
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle
test-windows-2019:
needs: "build-cruby-gem"
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0"]
sys: ["enable", "disable"]
runs-on: "windows-2019"
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: ${{ matrix.ruby }}
mingw: re2
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-gem
path: pkg
- run: ./scripts/test-gem-install --${{ matrix.sys }}-system-libraries
shell: bash
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle
test-windows-2022:
needs: "build-cruby-gem"
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3"]
sys: ["enable", "disable"]
runs-on: "windows-2022"
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: ${{ matrix.ruby }}
mingw: re2
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-gem
path: pkg
- run: ./scripts/test-gem-install --${{ matrix.sys }}-system-libraries
shell: bash
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle
test-freebsd:
needs: "build-cruby-gem"
strategy:
fail-fast: false
matrix:
sys: ["enable", "disable"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cruby-gem
path: pkg
- uses: vmactions/freebsd-vm@v1
with:
usesh: true
copyback: false
prepare: pkg install -y ruby devel/ruby-gems sysutils/rubygem-bundler devel/pkgconf devel/cmake shells/bash devel/re2
run: ./scripts/test-gem-install --${{ matrix.sys }}-system-libraries
test-vendored-and-system:
needs: "build-cruby-gem"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install RE2
run: sudo apt-get install -y libre2-dev
- uses: ruby/setup-ruby@v1
id: setup-ruby
with:
ruby-version: "3.3"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-gem
path: pkg
- name: "Link libre2 into Ruby's lib directory"
run: ln -s /usr/lib/x86_64-linux-gnu/libre2.so ${{ steps.setup-ruby.outputs.ruby-prefix }}/lib/libre2.so
- run: ./scripts/test-gem-install
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle
test-precompiled-aarch64-linux:
needs: "precompile-aarch64-linux"
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cruby-aarch64-linux-gem
path: pkg
- name: Enable execution of multi-architecture containers by QEMU
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- run: |
docker run --rm -v "$(pwd):/re2" -w /re2 \
--platform=linux/arm64/v8 \
ruby:${{ matrix.ruby }} \
./scripts/test-gem-install
test-precompiled-arm-linux:
needs: "precompile-arm-linux"
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cruby-arm-linux-gem
path: pkg
- name: enable execution of multi-architecture containers by qemu
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- run: |
docker run --rm -v "$(pwd):/re2" -w /re2 \
--platform=linux/arm/v7 \
ruby:${{ matrix.ruby }} \
./scripts/test-gem-install
test-precompiled-x86-linux:
needs: "precompile-x86-linux"
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cruby-x86-linux-gem
path: pkg
- name: Enable execution of multi-architecture containers by QEMU
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- run: |
docker run --rm -v "$(pwd):/re2" -w /re2 \
--platform=linux/386 \
ruby:${{ matrix.ruby }} \
./scripts/test-gem-install
test-precompiled-x86_64-linux:
needs: "precompile-x86_64-linux"
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-x86_64-linux-gem
path: pkg
- run: ./scripts/test-gem-install
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle
test-precompiled-arm64-darwin:
needs: "precompile-arm64-darwin"
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-arm64-darwin-gem
path: pkg
- run: ./scripts/test-gem-install
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle
test-precompiled-x86_64-darwin:
needs: "precompile-x86_64-darwin"
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-x86_64-darwin-gem
path: pkg
- run: ./scripts/test-gem-install
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle
test-precompiled-x64-mingw-ucrt:
needs: "precompile-x64-mingw-ucrt"
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3"]
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: MSP-Greg/setup-ruby-pkgs@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-x64-mingw-ucrt-gem
path: pkg
- run: ./scripts/test-gem-install
shell: bash
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle
test-precompiled-x64-mingw32:
needs: "precompile-x64-mingw32"
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0"]
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{ matrix.ruby }}"
bundler-cache: true
- uses: actions/download-artifact@v4
with:
name: cruby-x64-mingw32-gem
path: pkg
- run: ./scripts/test-gem-install
shell: bash
env:
BUNDLE_PATH: ${{ github.workspace }}/vendor/bundle
test-precompiled-x86_64-alpine:
needs: "precompile-x86_64-linux"
strategy:
fail-fast: false
matrix:
ruby: ["2.6", "2.7", "3.0", "3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
container:
image: "ruby:${{ matrix.ruby }}-alpine"
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cruby-x86_64-linux-gem
path: pkg
- run: apk add bash libstdc++ gcompat
- run: ./scripts/test-gem-install
ruby-memcheck:
runs-on: "ubuntu-latest"
env:
BUNDLE_WITH: memcheck
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ports/archives
key: archives-ubuntu-${{ hashFiles('dependencies.yml') }}
- uses: ruby/setup-ruby-pkgs@v1
with:
ruby-version: "3.3"
apt-get: valgrind
bundler-cache: true
- run: bundle exec rake spec:valgrind