Skip to content

Merge pull request #17 from godaddy/free_buffers #69

Merge pull request #17 from godaddy/free_buffers

Merge pull request #17 from godaddy/free_buffers #69

Workflow file for this run

name: Build
on:
pull_request:
branches:
- "*"
push:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ruby-${{ matrix.ruby }}
strategy:
matrix:
os: [ ubuntu-22.04, macos-15 ]
ruby: [ 2.7, 3.0, 3.1, 3.2, 3.3, 3.4, 4.0 ]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler: default
bundler-cache: true
- name: Setup Go
uses: actions/setup-go@v6.3.0
with:
go-version: '1.24'
- name: Build Linux
if: matrix.os == 'ubuntu-22.04'
shell: bash
run: |
mkdir -p tmp
cd spec/support/libcobhandemo
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -buildmode=c-shared -ldflags='-s -w' -o ../../../tmp/libcobhandemo-x64.so .
- name: Build Darwin
if: matrix.os == 'macos-15'
shell: bash
run: |
mkdir -p tmp
cd spec/support/libcobhandemo
CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build -buildmode=c-shared -ldflags='-s -w' -o ../../../tmp/libcobhandemo-arm64.dylib .
- name: Run specs
run: |
COVERAGE=true bundle exec rspec spec
- name: Run rubocop
run: |
bundle exec rubocop
build_arm64:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} ruby-${{ matrix.ruby }} arm64
strategy:
matrix:
include:
- { os: ubuntu-22.04, ruby: 3.2 }
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v6.3.0
with:
go-version: '1.24'
- name: Install OS dependencies
shell: bash
run: |
sudo apt-get update
sudo apt-get install gcc make gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu -y
- name: Build Linux ARM64
shell: bash
run: |
mkdir -p tmp
cd spec/support/libcobhandemo
CGO_ENABLED=1 GOOS=linux GOARCH=arm64 CC=aarch64-linux-gnu-gcc go build -v -buildmode=c-shared -ldflags='-s -w' -o ../../../tmp/libcobhandemo-arm64.so .
- name: Run specs and rubocop checks
shell: bash
run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm --volume "$(pwd):/cobhan" \
--platform linux/arm64/v8 \
--workdir /cobhan \
ruby:${{matrix.ruby}}-bullseye \
/bin/sh -c "bundle install; bundle exec rspec spec; bundle exec rubocop"