From 0622233fcd5456bc4f7747e3b8c39518169ff44a Mon Sep 17 00:00:00 2001 From: Joel Abshier Date: Tue, 30 Apr 2024 11:55:12 -0500 Subject: [PATCH] feat(ci): Add Github Test Action --- .github/workflows/mix-test.yml | 46 ++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/mix-test.yml diff --git a/.github/workflows/mix-test.yml b/.github/workflows/mix-test.yml new file mode 100644 index 0000000..8228a11 --- /dev/null +++ b/.github/workflows/mix-test.yml @@ -0,0 +1,46 @@ +name: Elixir Mix Tests + +on: + push: + branches: + - master + pull_request: + branches: + - '**' + +env: + MIX_ENV: test + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + otp: ['26.2.4'] + elixir: ['1.16.2'] + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Elixir + uses: erlef/setup-beam@v1 + with: + elixir-version: ${{matrix.otp}} + otp-version: ${{matrix.elixir}} + + - name: Install dependencies + run: mix deps.get + + - name: Cache deps + id: cache-deps + uses: actions/cache@v4 + env: + cache-name: cache-elixir-deps + with: + path: deps + key: ${{ runner.os }}-mix-${{ env.cache-name }}-${{ hashFiles('**/mix.lock') }} + restore-keys: | + ${{ runner.os }}-mix-${{ env.cache-name }}- + + - name: Run tests + run: mix test