diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml new file mode 100644 index 0000000..49d610d --- /dev/null +++ b/.github/workflows/elixir.yml @@ -0,0 +1,43 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +name: Elixir CI + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +permissions: + contents: read + +jobs: + build: + + name: Build and test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up Elixir + uses: erlef/setup-beam@61e01a43a562a89bfc54c7f9a378ff67b03e4a21 # v1.16.0 + with: + elixir-version: '1.15.7' # [Required] Define the Elixir version + otp-version: '26.1' # [Required] Define the Erlang/OTP version + - name: Restore dependencies cache + uses: actions/cache@v3 + with: + path: deps + key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-mix- + - name: Install dependencies + run: mix deps.get + - name: Check formatting + run: mix format --check-formatted + - name: Run credo + run: mix credo + - name: Run tests + run: mix test diff --git a/README.md b/README.md index 310560f..6aceaef 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Validators for Romanian CIF, CNP and IBAN [![Build Status](https://travis-ci.org/mtarnovan/validators_ro.svg?branch=master)](https://travis-ci.org/mtarnovan/validators_ro) +![CI status](https://github.com/mtarnovan/validators_ro/actions/workflows/elixir.yml/badge.svg?branch=master) + An [Elixir](https://elixir-lang.org/) collection of validators and utilities