Test NixOS #2625
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- macos-latest | |
- ubuntu-latest | |
- windows-latest | |
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 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler-cache: true | |
- name: Compile | |
run: bundle exec rake compile | |
- name: Spec | |
run: bundle exec rake spec | |
- name: Install | |
run: rake -f -r bundler/gem_tasks install | |
spec-musl: | |
name: spec (alpine-latest, ${{ matrix.ruby-version }}) | |
runs-on: ubuntu-latest | |
container: | |
image: docker.io/library/ruby:${{ matrix.ruby-version }}-alpine | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby-version: | |
- '3.1' | |
- '3.2' | |
- '3.3' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: apk add build-base | |
- name: Bundle | |
run: bundle install | |
- name: Compile | |
run: bundle exec rake compile | |
- name: Install | |
run: rake -f -r bundler/gem_tasks install | |
- name: Spec | |
run: bundle exec rake spec | |
spec-nix: | |
name: spec (nix-latest) | |
runs-on: ubuntu-latest | |
services: | |
nix: | |
image: docker.io/nixos/nix:latest | |
options: --tty | |
volumes: | |
- ${{ github.workspace }}:${{ github.workspace }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup shell | |
run: | | |
mkdir -p "$HOME/.local/bin" && tee "$HOME/.local/bin/bash" <<'EOF' && chmod a+x "$HOME/.local/bin/bash" | |
#!/bin/bash -- | |
exec docker exec -i -w "$PWD" ${{ job.services.nix.id }} nix-shell --packages ruby --run "exec \"\$SHELL\"$(test $# -gt 0 && printf ' %q' "${@:1:$#-1}")" <"${@:$#}" | |
EOF | |
- name: Bundle | |
run: bundle install | |
- name: Compile | |
run: bundle exec rake compile | |
- name: Install | |
run: rake -f -r bundler/gem_tasks install | |
- name: Spec | |
run: bundle exec rake spec | |
spec-bsd: | |
name: spec (${{ matrix.vm }}-latest) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- vm: freebsd | |
install-dependencies: | | |
pkg install -y node npm protobuf ruby rubygem-bundler rubygem-rake | |
- vm: openbsd | |
install-dependencies: | | |
ruby=$(pkg_info -Q ruby | grep '^ruby-[0-9]' | sort -rV | head -n 1) | |
pkg_add node protobuf $ruby | |
pkg_info $ruby | grep 'ln -sf' | $SHELL | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup vm | |
if: matrix.vm == 'freebsd' | |
uses: vmactions/freebsd-vm@v1 | |
- name: Setup vm | |
if: matrix.vm == 'openbsd' | |
uses: vmactions/openbsd-vm@v1 | |
- name: Setup shell | |
run: | | |
mkdir -p "$HOME/.local/bin" && tee "$HOME/.local/bin/bash" <<'EOF' && chmod a+x "$HOME/.local/bin/bash" | |
#!/bin/bash -- | |
exec ssh ${{ matrix.vm }} "cd $(printf %q "$PWD") && exec \"\$SHELL\"$(test $# -gt 0 && printf ' %q' "${@:1:$#-1}")" <"${@:$#}" | |
EOF | |
- name: Install dependencies | |
run: ${{ matrix.install-dependencies }} | |
- name: Bundle | |
run: bundle install | |
- name: Compile | |
run: EMBEDDED_SASS_PROTOCOL=https://github.com/sass/sass/raw/HEAD/spec/embedded_sass.proto PROTOC_BIN=$(which protoc) bundle exec rake compile | |
- name: Install | |
run: rake -f -r bundler/gem_tasks install | |
# TODO: https://github.com/sass/dart-sass/pull/2413 | |
# - name: Spec | |
# run: bundle exec rake spec | |
release: | |
if: github.event.repository.fork == false && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) | |
needs: [lint, spec, spec-musl, spec-nix, spec-bsd] | |
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 |