Skip to content

Commit b30c494

Browse files
authored
Refactor CI workflow (#43)
## Description This PR renames and refactors the project's GitHub Actions CI workflow. The updated workflow will now run on: - pushes to `main`, - pull requests against `main`, and - by manual invocation via GitHub's UI Notable changes to the workflow include: - refactors existing Ubuntu test job - adds a new macOS test job - specifies oldest and newest Elixir and Erlang combo in the matrix - use latest [actions/checkout](https://github.com/actions/checkout) - sets job name to use matrix values for clarity The macOS job takes a necessarily different tact for installing Erlang and Elixir owing to the underlying `erlef/setup-beam` workflow not (yet) supporting macOS (see erlef/setup-beam#54).
2 parents 7b39e05 + 5e8b883 commit b30c494

File tree

3 files changed

+75
-54
lines changed

3 files changed

+75
-54
lines changed

.github/workflows/ci.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
workflow_dispatch:
9+
10+
env:
11+
MIX_ENV: test
12+
13+
jobs:
14+
test_macos:
15+
name: Elixir ${{ matrix.pair.elixir }} OTP ${{ matrix.pair.otp }} (macOS)
16+
runs-on: macos-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
pair:
21+
- elixir: "1.13"
22+
otp: "24.3.4.10"
23+
- elixir: "1.17"
24+
otp: "27.0.1"
25+
steps:
26+
- uses: actions/checkout@v4
27+
- name: Generate .tool-versions file
28+
run: |
29+
echo "elixir ${{ matrix.pair.elixir }}" >> .tool-versions
30+
echo "erlang ${{ matrix.pair.otp }}" >> .tool-versions
31+
cat .tool-versions
32+
- uses: asdf-vm/actions/install@v3
33+
- name: Install Hex package manager
34+
run: mix local.hex --force
35+
- name: Install dependencies
36+
run: mix deps.get
37+
- run: mix test
38+
test_ubuntu:
39+
name: Elixir ${{ matrix.pair.elixir }} OTP ${{ matrix.pair.otp }} (Ubuntu)
40+
runs-on: ubuntu-latest
41+
strategy:
42+
fail-fast: false
43+
matrix:
44+
include:
45+
- pair:
46+
elixir: "1.13"
47+
otp: "24.3.4.10"
48+
- pair:
49+
elixir: "1.17"
50+
otp: "27.0.1"
51+
lint: lint
52+
steps:
53+
- uses: actions/checkout@v4
54+
- uses: erlef/setup-beam@main
55+
with:
56+
otp-version: ${{ matrix.pair.otp }}
57+
elixir-version: ${{ matrix.pair.elixir }}
58+
version-type: strict
59+
- uses: actions/cache@v4
60+
with:
61+
path: deps
62+
key: mix-deps-${{ hashFiles('**/mix.lock') }}
63+
- run: mix deps.get --check-locked
64+
- run: mix format --check-formatted
65+
if: ${{ matrix.lint }}
66+
- run: mix deps.unlock --check-unused
67+
if: ${{ matrix.lint }}
68+
- run: mix deps.compile
69+
- run: mix compile --warnings-as-errors
70+
if: ${{ matrix.lint }}
71+
- run: mix test
72+
if: ${{ ! matrix.lint }}
73+
- run: mix test --warnings-as-errors
74+
if: ${{ matrix.lint }}

.github/workflows/main.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DartSass
22

3-
[![CI](https://github.com/CargoSense/dart_sass/actions/workflows/main.yml/badge.svg)](https://github.com/CargoSense/dart_sass/actions/workflows/main.yml)
3+
[![CI](https://github.com/CargoSense/dart_sass/actions/workflows/ci.yml/badge.svg)](https://github.com/CargoSense/dart_sass/actions/workflows/ci.yml)
44

55
Mix tasks for installing and invoking [sass](https://github.com/sass/dart-sass/).
66

0 commit comments

Comments
 (0)