Skip to content

Commit

Permalink
chore: add github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hwuethrich committed Aug 21, 2024
1 parent 8015e7f commit e28c7d9
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI/CD

on:
push:

pull_request:
branches:
- main

env:
MIX_ENV: test

jobs:
test:
name: Run tests
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
version-file: .tool-versions
version-type: strict

# - name: Set up Node.js
# uses: actions/setup-node@v4
# with:
# node-version-file: .tool-versions
# cache: npm
# cache-dependency-path: assets/package-lock.json

- name: Restore cache
id: cache
uses: actions/cache/restore@v4
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ hashFiles('.tool-versions') }}-${{ hashFiles('mix.lock') }}
restore-keys: |
${{ runner.os }}-mix-${{ hashFiles('.tool-versions') }}-
${{ runner.os }}-mix-
- run: mix setup

- name: Save cache
uses: actions/cache/save@v4
if: steps.cache.outputs.cache-hit != 'true'
with:
path: |
deps
_build
key: ${{ runner.os }}-mix-${{ hashFiles('.tool-versions') }}-${{ hashFiles('mix.lock') }}

- run: mix lint
- run: mix test

0 comments on commit e28c7d9

Please sign in to comment.