Skip to content

Commit 2919348

Browse files
committed
Test NixOS
1 parent dd6dd72 commit 2919348

File tree

1 file changed

+43
-14
lines changed

1 file changed

+43
-14
lines changed

.github/workflows/build.yml

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
- name: Install
7171
run: rake -f -r bundler/gem_tasks install
7272

73-
spec-container:
73+
spec-musl:
7474

7575
name: spec (alpine-latest, ${{ matrix.ruby-version }})
7676

@@ -106,7 +106,43 @@ jobs:
106106
- name: Spec
107107
run: bundle exec rake spec
108108

109-
spec-vm:
109+
spec-nix:
110+
111+
name: spec (nix-latest)
112+
113+
runs-on: ubuntu-latest
114+
115+
services:
116+
nix:
117+
image: docker.io/nixos/nix:latest
118+
options: --tty
119+
volumes:
120+
- ${{ github.workspace }}:${{ github.workspace }}
121+
122+
steps:
123+
- name: Checkout
124+
uses: actions/checkout@v4
125+
126+
- name: Setup shell
127+
run: |
128+
mkdir -p "$HOME/.local/bin" && tee "$HOME/.local/bin/bash" <<'EOF' && chmod a+x "$HOME/.local/bin/bash"
129+
#!/bin/bash --
130+
exec docker exec -i -w "$PWD" ${{ job.services.nix.id }} nix-shell --packages ruby --run "exec \"\$SHELL\"$(test $# -gt 0 && printf ' %q' "${@:1:$#-1}")" <"${@:$#}"
131+
EOF
132+
133+
- name: Bundle
134+
run: bundle install
135+
136+
- name: Compile
137+
run: bundle exec rake compile
138+
139+
- name: Install
140+
run: rake -f -r bundler/gem_tasks install
141+
142+
- name: Spec
143+
run: bundle exec rake spec
144+
145+
spec-bsd:
110146

111147
name: spec (${{ matrix.vm }}-latest)
112148

@@ -137,41 +173,34 @@ jobs:
137173
if: matrix.vm == 'openbsd'
138174
uses: vmactions/openbsd-vm@v1
139175

140-
- name: Setup vmshell
176+
- name: Setup shell
141177
run: |
142-
_osname=${{ matrix.vm }}
143-
tee /home/runner/.local/bin/vmshell <<EOF
144-
#!/usr/bin/env bash
145-
ssh $_osname "cd \$(printf %q "\$PWD") && exec \\\$SHELL -e"<\$1
178+
mkdir -p "$HOME/.local/bin" && tee "$HOME/.local/bin/bash" <<'EOF' && chmod a+x "$HOME/.local/bin/bash"
179+
#!/bin/bash --
180+
exec ssh ${{ matrix.vm }} "cd $(printf %q "$PWD") && exec \"\$SHELL\"$(test $# -gt 0 && printf ' %q' "${@:1:$#-1}")" <"${@:$#}"
146181
EOF
147-
chmod a+x /home/runner/.local/bin/vmshell
148182
149183
- name: Install dependencies
150184
run: ${{ matrix.install-dependencies }}
151-
shell: vmshell {0}
152185

153186
- name: Bundle
154187
run: bundle install
155-
shell: vmshell {0}
156188

157189
- name: Compile
158190
run: EMBEDDED_SASS_PROTOCOL=https://github.com/sass/sass/raw/HEAD/spec/embedded_sass.proto PROTOC_BIN=$(which protoc) bundle exec rake compile
159-
shell: vmshell {0}
160191

161192
- name: Install
162193
run: rake -f -r bundler/gem_tasks install
163-
shell: vmshell {0}
164194

165195
# TODO: https://github.com/sass/dart-sass/pull/2413
166196
# - name: Spec
167197
# run: bundle exec rake spec
168-
# shell: freebsd {0}
169198

170199
release:
171200

172201
if: github.event.repository.fork == false && github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
173202

174-
needs: [lint, spec, spec-container, spec-vm]
203+
needs: [lint, spec, spec-musl, spec-nix, spec-bsd]
175204

176205
runs-on: ubuntu-latest
177206

0 commit comments

Comments
 (0)