Skip to content

Commit 8b57dd1

Browse files
committed
Add support for Elixir 1.8 and build matrix
1 parent 7a6c56b commit 8b57dd1

File tree

3 files changed

+81
-8
lines changed

3 files changed

+81
-8
lines changed

.github/workflows/ci.yml

+15-7
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,22 @@ on: [push, pull_request]
55
jobs:
66
ci:
77
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
elixir-version: [1.10.x, 1.9.x, 1.8.x]
11+
include:
12+
- elixir-version: 1.10.x
13+
otp-version: 22.x
14+
- elixir-version: 1.9.x
15+
otp-version: 21.x
16+
- elixir-version: 1.8.x
17+
otp-version: 20.x
818
steps:
919
- uses: actions/checkout@v2
1020
- uses: actions/setup-elixir@v1
1121
with:
12-
otp-version: 22.2
13-
elixir-version: 1.10.0
14-
- run: mix deps.get
15-
- run: mix format --check-formatted
16-
- run: mix compile --warnings-as-errors --force
17-
- run: mix credo --strict
18-
- run: mix test
22+
otp-version: ${{matrix.otp-version}}
23+
elixir-version: ${{matrix.elixir-version}}
24+
- run: make dependencies
25+
- run: make lint
26+
- run: make test

Makefile

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Configuration
2+
# -------------
3+
4+
APP_NAME = `grep 'app:' mix.exs | sed -e 's/\[//g' -e 's/ //g' -e 's/app://' -e 's/[:,]//g'`
5+
APP_VERSION = `grep '@version ' mix.exs | cut -d '"' -f2`
6+
GIT_REVISION = `git rev-parse HEAD`
7+
8+
# Introspection targets
9+
# ---------------------
10+
11+
.PHONY: help
12+
help: header targets
13+
14+
.PHONY: header
15+
header:
16+
@echo "\033[34mEnvironment\033[0m"
17+
@echo "\033[34m---------------------------------------------------------------\033[0m"
18+
@printf "\033[33m%-23s\033[0m" "APP_NAME"
19+
@printf "\033[35m%s\033[0m" $(APP_NAME)
20+
@echo ""
21+
@printf "\033[33m%-23s\033[0m" "APP_VERSION"
22+
@printf "\033[35m%s\033[0m" $(APP_VERSION)
23+
@echo ""
24+
@printf "\033[33m%-23s\033[0m" "GIT_REVISION"
25+
@printf "\033[35m%s\033[0m" $(GIT_REVISION)
26+
@echo "\n"
27+
28+
.PHONY: targets
29+
targets:
30+
@echo "\033[34mTargets\033[0m"
31+
@echo "\033[34m---------------------------------------------------------------\033[0m"
32+
@perl -nle'print $& if m{^[a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-22s\033[0m %s\n", $$1, $$2}'
33+
34+
# Development targets
35+
# -------------------
36+
37+
.PHONY: dependencies
38+
dependencies: ## Install dependencies
39+
mix deps.get --force
40+
41+
# CI targets
42+
# ----------
43+
44+
.PHONY: lint
45+
lint: lint-compile lint-format lint-credo ## Run lint tools on the code
46+
47+
.PHONY: lint-compile
48+
lint-compile:
49+
mix compile --warnings-as-errors --force
50+
51+
.PHONY: lint-format
52+
lint-format:
53+
mix format --dry-run --check-formatted
54+
55+
.PHONY: lint-credo
56+
lint-credo:
57+
mix credo --strict
58+
59+
.PHONY: test
60+
test: ## Run the test suite
61+
mix test
62+
63+
.PHONY: format
64+
format: ## Run formatting tools on the code
65+
mix format

mix.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ defmodule MixAudit.MixProject do
77
[
88
app: :mix_audit,
99
version: @version,
10-
elixir: "~> 1.9",
10+
elixir: "~> 1.8",
1111
description: "MixAudit provides a `mix deps.audit` task to scan a project Mix dependencies for known Elixir security vulnerabilities",
1212
source_url: "https://github.com/mirego/mix_audit",
1313
homepage_url: "https://github.com/mirego/mix_audit",

0 commit comments

Comments
 (0)