From 04839306453c9733a4f5755e0167126762dc90bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihai=20T=C3=A2rnovan?= Date: Sun, 14 Jan 2024 11:30:19 +0200 Subject: [PATCH 1/3] Create elixir.yml --- .github/workflows/elixir.yml | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/elixir.yml diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml new file mode 100644 index 0000000..2c1148c --- /dev/null +++ b/.github/workflows/elixir.yml @@ -0,0 +1,39 @@ +# 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: Run tests + run: mix test From d5535e54af539397b2b235eddf7fe3a6e717c6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihai=20T=C3=A2rnovan?= Date: Sun, 14 Jan 2024 11:32:43 +0200 Subject: [PATCH 2/3] Add format check, credo --- .github/workflows/elixir.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml index 2c1148c..49d610d 100644 --- a/.github/workflows/elixir.yml +++ b/.github/workflows/elixir.yml @@ -35,5 +35,9 @@ jobs: 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 From cff69e16a3b08ae256195b22b196fea9c9bb84ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihai=20T=C3=A2rnovan?= Date: Sun, 14 Jan 2024 11:35:32 +0200 Subject: [PATCH 3/3] Add CI badge --- README.md | 2 ++ 1 file changed, 2 insertions(+) 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