From 7a19ee4591cee7845b05d997aca405be7363ff0c Mon Sep 17 00:00:00 2001 From: Ben Youngblood Date: Tue, 29 Aug 2023 11:45:25 -0700 Subject: [PATCH] Set up Github Actions --- .github/workflows/elixir.yml | 60 ++++++++++++++++++++++++++++++++++++ 1 file changed, 60 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..f31a5f6 --- /dev/null +++ b/.github/workflows/elixir.yml @@ -0,0 +1,60 @@ +# 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: [ "main" ] + pull_request: + branches: [ "main" ] + +permissions: + contents: read + +jobs: + build: + + name: Build and test + runs-on: ubuntu-latest + + env: + MIX_ENV: test + + steps: + - uses: actions/checkout@v3 + + - name: Set up Elixir + uses: erlef/setup-beam@61e01a43a562a89bfc54c7f9a378ff67b03e4a21 # v1.16.0 + with: + elixir-version: '1.15.5' # [Required] Define the Elixir version + otp-version: '26.0' # [Required] Define the Erlang/OTP version + + - name: Restore dependencies cache + uses: actions/cache@v3 + with: + path: deps + key: ${{ runner.os }}-mix-deps-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-mix-deps- + + - name: Restore build cache + uses: actions/cache@v3 + with: + path: _build + key: ${{ runner.os }}-mix-build-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-mix-build- + + - name: Install dependencies + run: mix do deps.get, deps.compile + + + - name: Run Credo + run: mix credo + + - name: Run tests + run: mix test + + - name: Run Dialyzer + run: mix dialyzer