-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (83 loc) · 2.62 KB
/
build.yml
File metadata and controls
98 lines (83 loc) · 2.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
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"