diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3c966e2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: CI + +on: + pull_request: + push: + branches: + - master + +jobs: + test: + runs-on: ubuntu-18.04 + env: + MIX_ENV: test + strategy: + fail-fast: false + matrix: + include: + - pair: + elixir: 1.6 + otp: 19 + - pair: + elixir: 1.12 + otp: 24 + lint: lint + steps: + - uses: actions/checkout@v2 + + - uses: erlef/setup-elixir@v1 + with: + otp-version: ${{matrix.pair.otp}} + elixir-version: ${{matrix.pair.elixir}} + + - uses: actions/cache@v2 + with: + path: | + deps + _build + key: ${{ runner.os }}-mix-${{matrix.pair.elixir}}-${{matrix.pair.otp}}-${{ hashFiles('**/mix.lock') }} + restore-keys: | + ${{ runner.os }}-mix- + + - run: mix deps.get + + - run: mix format --check-formatted + if: ${{ matrix.lint }} + + - run: mix deps.unlock --check-unused + if: ${{ matrix.lint }} + + - run: mix deps.compile + + - run: mix compile --warnings-as-errors + if: ${{ matrix.lint }} + + - run: mix test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7c366ef..0000000 --- a/.travis.yml +++ /dev/null @@ -1,25 +0,0 @@ -sudo: false -language: elixir - -elixir: '1.10' -otp_release: '22.0' - -stages: - - check formatted - - test - -jobs: - include: - - stage: check formatted - script: mix format --check-formatted - - - stage: test - - - elixir: 1.4 - otp_release: 19.3 - - elixir: 1.9 - otp_release: 20.3 - - elixir: 1.9 - otp_release: 21.3 - - elixir: 1.10 - otp_release: 22.0 diff --git a/README.md b/README.md index 3355c77..e213b97 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # MakeupC -A [Makeup](https://github.com/tmbb/makeup/) lexer for the C language. + +[![Build Status](https://github.com/elixir-makeup/makeup_c/workflows/CI/badge.svg)](https://github.com/elixir-makeup/makeup_c/actions) + +A [Makeup](https://github.com/elixir-makeup/makeup/) lexer for the C language. ## Installation diff --git a/mix.exs b/mix.exs index dffd464..c0a828c 100644 --- a/mix.exs +++ b/mix.exs @@ -8,7 +8,7 @@ defmodule MakeupC.MixProject do [ app: :makeup_c, version: @version, - elixir: "~> 1.4", + elixir: "~> 1.6", start_permanent: Mix.env() == :prod, deps: deps(), # Package @@ -46,7 +46,7 @@ defmodule MakeupC.MixProject do defp deps do [ {:makeup, "~> 1.0"}, - {:ex_doc, ">= 0.0.0", only: [:dev, :docs]}, + {:ex_doc, ">= 0.0.0", only: [:dev, :docs]} ] end @@ -57,5 +57,4 @@ defmodule MakeupC.MixProject do main: "Makeup.Lexers.CLexer" ] end - end