From 4fb70649b5971b34bd99d9b0d7be917a13935732 Mon Sep 17 00:00:00 2001 From: Justin Schneck Date: Thu, 4 Apr 2024 15:14:05 -0400 Subject: [PATCH] Add github actions --- .github/workflows/build_test.yml | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/build_test.yml diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml new file mode 100644 index 0000000..78993d4 --- /dev/null +++ b/.github/workflows/build_test.yml @@ -0,0 +1,41 @@ +name: Build and Test + +on: + pull_request: + branches: + - "**" + push: + branches: + - main + +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@v1 + with: + elixir-version: '1.16.2' + otp-version: '26.2.3' + - name: Restore dependencies cache + uses: actions/cache@v3 + with: + path: deps + key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-mix- + - name: Get dependencies and compile + run: | + mix deps.get + mix compile --warnings-as-errors + - name: Verify formatting + run: mix format --check-formatted + - name: Audit dependencies + run: mix hex.audit + - name: Run tests + run: mix test