-
Notifications
You must be signed in to change notification settings - Fork 5
169 lines (142 loc) · 4.43 KB
/
build.yml
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
name: build
on:
pull_request:
push:
branches:
- '**'
tags-ignore:
- 'v*'
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby
bundler-cache: true
- name: Lint
run: bundle exec rake rubocop
spec:
runs-on: ${{ matrix.os }}
container: ${{ matrix.container.image != 'docker.io/nixos/nix:latest' && matrix.container || null }}
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
container:
-
vm:
-
ruby-version:
- '3.1'
- '3.2'
- '3.3'
- jruby
- truffleruby
- truffleruby+graalvm
exclude:
- os: windows-latest
ruby-version: truffleruby
- os: windows-latest
ruby-version: truffleruby+graalvm
include:
- os: ubuntu-latest
container:
image: docker.io/library/ruby:3.1-alpine
- os: ubuntu-latest
container:
image: docker.io/library/ruby:3.2-alpine
- os: ubuntu-latest
container:
image: docker.io/library/ruby:3.3-alpine
- os: ubuntu-latest
container:
image: docker.io/nixos/nix:latest
- os: ubuntu-latest
vm:
os: freebsd
run: pkg install -y node npm protobuf ruby rubygem-bundler rubygem-rake
- os: ubuntu-latest
vm:
os: openbsd
run: |
pkg_add node protobuf ruby%3.3 ruby-shims
echo 3.3 | tee /etc/ruby-version
- os: ubuntu-latest
vm:
os: netbsd
run: /usr/sbin/pkg_add nodejs protobuf ruby
- os: ubuntu-latest
vm:
os: dragonflybsd
run: pkg install -y libnghttp2 libuv node npm protobuf ruby rubygem-bundler rubygem-rake
- os: ubuntu-latest
vm:
os: omnios
run: |
pkg install build-essential node-22 protobuf ruby-33
pkg install "$(pkg search -HI -o pkg.name "$(ruby -e 'puts RbConfig::CONFIG["CC"]')")"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Initialize vm
if: matrix.vm
uses: ./.github/actions/setup-vm
with:
os: ${{ matrix.vm.os }}
run: ${{ matrix.vm.run }}
- name: Initialize nix
if: matrix.container.image == 'docker.io/nixos/nix:latest'
uses: ./.github/actions/setup-nix
with:
image: ${{ matrix.container.image }}
packages: ruby
- name: Install dependencies
if: endsWith(matrix.container.image, ':alpine') || endsWith(matrix.container.image, '-alpine')
run: apk add build-base
- name: Setup ruby
if: matrix.ruby-version
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true
- name: Bundle
if: "!matrix.ruby-version"
run: bundle install
- name: Compile
if: "!matrix.vm"
run: bundle exec rake compile
- name: Compile
if: matrix.vm
run: EMBEDDED_SASS_PROTOCOL=https://github.com/sass/sass/raw/HEAD/spec/embedded_sass.proto PROTOC_BIN=$(which protoc) bundle exec rake compile
- name: Spec
if: "!matrix.vm" # TODO: https://github.com/sass/dart-sass/pull/2413
run: bundle exec rake spec
- name: Install
run: rake -f -r bundler/gem_tasks install
release:
if: github.event.repository.fork == false && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
needs: [lint, spec]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.DEPLOY_KEY }}
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ruby
- name: Release
run: |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git config user.name github-actions[bot]
rake -f -r bundler/gem_tasks release gem_push=no