|
9 | 9 |
|
10 | 10 | jobs: |
11 | 11 | build: |
| 12 | + runs-on: ubuntu-latest |
12 | 13 |
|
13 | | - name: Build and test |
14 | | - runs-on: ubuntu-20.04 |
| 14 | + env: |
| 15 | + MIX_ENV: test |
| 16 | + |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + elixir: [1.18.4] |
| 20 | + otp: [28.0.2] |
15 | 21 |
|
16 | 22 | steps: |
17 | | - - uses: actions/checkout@v2 |
18 | | - - name: System dependencies |
19 | | - run: | |
20 | | - sudo apt update |
21 | | - sudo apt install -y inotify-tools |
22 | | - - name: Set up Elixir |
23 | | - uses: erlef/setup-beam@988e02bfe678367a02564f65ca2e37726dc0268f |
24 | | - with: |
25 | | - elixir-version: '1.12.3' # Define the elixir version [required] |
26 | | - otp-version: '24.1' # Define the OTP version [required] |
27 | | - - name: Restore dependencies cache |
28 | | - uses: actions/cache@v2 |
29 | | - with: |
30 | | - path: deps |
31 | | - key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} |
32 | | - restore-keys: ${{ runner.os }}-mix- |
33 | | - - name: Install dependencies |
34 | | - run: mix deps.get |
35 | | - - name: Run tests |
36 | | - run: mix test |
37 | | - - name: Run static analytics |
38 | | - run: mix credo suggest --all --strict |
| 23 | + - uses: actions/checkout@v4 |
| 24 | + - name: System Dependencies |
| 25 | + run: | |
| 26 | + sudo apt update |
| 27 | + sudo apt install -y inotify-tools |
| 28 | + - name: Setup Elixir |
| 29 | + uses: erlef/setup-beam@v1 |
| 30 | + with: |
| 31 | + otp-version: ${{ matrix.otp }} |
| 32 | + elixir-version: ${{ matrix.elixir }} |
| 33 | + - name: Restore dependencies cache |
| 34 | + uses: actions/cache@v4 |
| 35 | + with: |
| 36 | + path: | |
| 37 | + deps |
| 38 | + _build |
| 39 | + key: mix-${{ runner.os }}-${{matrix.elixir}}-${{matrix.otp}}-${{ hashFiles('**/mix.lock') }} |
| 40 | + restore-keys: | |
| 41 | + mix-${{ runner.os }}-${{matrix.elixir}}-${{matrix.otp}}- |
| 42 | +
|
| 43 | + - name: Install dependencies |
| 44 | + run: mix deps.get |
| 45 | + - name: Check code format |
| 46 | + run: mix format --check-formatted |
| 47 | + - name: Run static analysis |
| 48 | + run: mix credo --strict |
| 49 | + - name: Check for unneeded dependencies |
| 50 | + run: mix deps.unlock --check-unused |
| 51 | + - name: Run tests |
| 52 | + run: mix test |
0 commit comments