NHSU CR-302 MIS BLOCKER EMAIL VALIDATOR OF ENTIRE EHCS #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: [push, pull_request, workflow_dispatch] | |
env: | |
ELIXIR_VERISON: 1.12.2 | |
OTP_VERSION: 24.0 | |
jobs: | |
build: | |
name: Build Stage | |
runs-on: ubuntu-latest | |
env: | |
MIX_ENV: test | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
all_but_latest: true | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ env.ELIXIR_VERISON }} | |
otp-version: ${{ env.OTP_VERSION }} | |
- name: Retrieve Cached Dependencies | |
uses: actions/cache@v2 | |
id: mix-cache | |
with: | |
path: | | |
deps | |
_build | |
key: ${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERISON }}-${{ env.MIX_ENV }}-${{ hashFiles('mix.lock') }} | |
- name: Install Mix Dependencies | |
if: steps.mix-cache.outputs.cache-hit != 'true' | |
run: | | |
mix local.rebar --force | |
mix local.hex --force | |
mix deps.get | |
mix deps.compile --skip-umbrella-children | |
linter: | |
name: Linter Stage | |
needs: build | |
runs-on: ubuntu-latest | |
env: | |
MIX_ENV: test | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
all_but_latest: true | |
access_token: ${{ github.token }} | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ env.ELIXIR_VERISON }} | |
otp-version: ${{ env.OTP_VERSION }} | |
- name: Retrieve Cached Dependencies | |
uses: actions/cache@v2 | |
id: mix-cache | |
with: | |
path: | | |
deps | |
_build | |
key: ${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERISON }}-${{ env.MIX_ENV }}-${{ hashFiles('mix.lock') }} | |
- name: Check Formatting | |
run: mix format --check-formatted | |
- name: Run Credo | |
run: mix credo --strict | |
tests: | |
name: Tests Stage | |
needs: build | |
runs-on: ubuntu-latest | |
env: | |
MIX_ENV: test | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
with: | |
all_but_latest: true | |
access_token: ${{ github.token }} | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Set up Elixir | |
uses: erlef/setup-beam@v1 | |
with: | |
elixir-version: ${{ env.ELIXIR_VERISON }} | |
otp-version: ${{ env.OTP_VERSION }} | |
- name: Retrieve Cached Dependencies | |
uses: actions/cache@v2 | |
id: mix-cache | |
with: | |
path: | | |
deps | |
_build | |
key: ${{ runner.os }}-${{ env.OTP_VERSION }}-${{ env.ELIXIR_VERISON }}-${{ env.MIX_ENV }}-${{ hashFiles('mix.lock') }} | |
- name: Run Unit Tests | |
run: | | |
mix coveralls.github --umbrella | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |