diff --git a/.github/workflows/elixir.yml b/.github/workflows/elixir.yml new file mode 100644 index 0000000..db08cf0 --- /dev/null +++ b/.github/workflows/elixir.yml @@ -0,0 +1,43 @@ +name: Elixir CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + name: Build and test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Elixir + uses: erlef/setup-elixir@885971a72ed1f9240973bd92ab57af8c1aa68f24 + with: + elixir-version: '1.12.2' # Define the elixir version [required] + otp-version: '24..' # Define the OTP version [required] + - name: Restore dependencies cache + uses: actions/cache@v2 + with: + working-directory: ./backend + path: deps + key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-mix- + - name: Install dependencies + working-directory: ./backend + run: | + mix local.hex --force + mix local.rebar --force + mix deps.get + - name: Compile dependencies + working-directory: ./backend + run: mix deps.compile + - name: Run Credo + working-directory: ./backend + run: mix credo --strict + - name: Run sobelow + working-directory: ./backend + run: mix sobelow --config