Skip to content

Commit ed78ba7

Browse files
committed
Add job for alpine
1 parent d33822e commit ed78ba7

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

.github/workflows/build.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,80 @@ jobs:
9696
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
9797
matrix: ${{ toJson(matrix) }}
9898

99+
build-and-test-alpine:
100+
name: "build-and-test-alpine (Go ${{ matrix.go }}, Ruby ${{ matrix.ruby }})"
101+
102+
needs:
103+
- generate-matrix
104+
105+
runs-on: ubuntu-latest
106+
107+
container: "ruby:${{ matrix.ruby }}-alpine"
108+
109+
strategy:
110+
fail-fast: false
111+
112+
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
113+
114+
steps:
115+
- uses: actions/checkout@v4
116+
117+
- uses: actions/setup-go@v5
118+
with:
119+
go-version: ${{ matrix.go }}
120+
121+
- run: apk update
122+
- run: apk add git alpine-sdk libffi-dev
123+
124+
- name: bundle install
125+
run: |
126+
set -xe
127+
bundle config --local path vendor/bundle/
128+
bundle install --jobs 4
129+
130+
- name: Cache vendor/bundle
131+
uses: actions/cache@v4
132+
with:
133+
path: vendor/bundle
134+
key: v1-alpine-${{ matrix.ruby }}-${{ github.sha }}
135+
restore-keys: |
136+
v1-alpine-${{ matrix.ruby }}-
137+
138+
- name: build and test (Go)
139+
run: |
140+
set -xe
141+
bundle exec rake go:test
142+
bundle exec rake go:testrace
143+
144+
- name: build and test (Ruby)
145+
run: bundle exec rake
146+
working-directory: ${{ env.TEST_GEM_DIR }}
147+
148+
# FIXME: workaround for gcov2lcov warning
149+
- run: rm -rf vendor/
150+
151+
- name: Convert coverage to lcov
152+
uses: jandelgado/gcov2lcov-action@v1
153+
with:
154+
infile: coverage.out
155+
outfile: coverage.lcov
156+
157+
- name: Coveralls
158+
uses: coverallsapp/github-action@master
159+
with:
160+
github-token: ${{ secrets.GITHUB_TOKEN }}
161+
path-to-lcov: coverage.lcov
162+
continue-on-error: true # NOTE: secrets cannot be obtained with forked repository PR
163+
164+
- name: Slack Notification (not success)
165+
uses: act10ns/slack@v2
166+
if: "! success()"
167+
continue-on-error: true
168+
with:
169+
status: ${{ job.status }}
170+
webhook-url: ${{ secrets.SLACK_WEBHOOK }}
171+
matrix: ${{ toJson(matrix) }}
172+
99173
go-lint:
100174
name: "go-lint (Ruby ${{ matrix.ruby }})"
101175

@@ -235,6 +309,7 @@ jobs:
235309
notify:
236310
needs:
237311
- build-and-test
312+
- build-and-test-alpine
238313
- go-lint
239314
- ruby-lint
240315
- ruby-rbs

_gem/lib/go_gem/rake_task.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ def self.build_env_vars
113113
ldflags.gsub!("-Wl,--unresolved-symbols=ignore-all", "")
114114
end
115115

116+
# FIXME: Workaround for Alpine
117+
if RUBY_PLATFORM =~ /linux-musl/i
118+
cflags.gsub!("-Wpointer-arith", "")
119+
end
120+
116121
ld_library_path = RbConfig::CONFIG["libdir"].to_s
117122

118123
{

0 commit comments

Comments
 (0)