diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5834725..c8cfbf0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,75 +1,69 @@ name: CI on: - push: - branches: [ master ] pull_request: - branches: [ master ] + push: + branches: + - master jobs: - format: - name: Check Formatting - runs-on: ubuntu-16.04 - steps: - - uses: actions/checkout@v2 - - - name: Set up Elixir - uses: erlef/setup-elixir@v1 - with: - otp-version: 22.2 - elixir-version: 1.10.4 - - - name: Install dependencies - run: mix deps.get - - - name: Run "mix format" - run: mix format --check-formatted - test: - name: Build and test - runs-on: ubuntu-16.04 + runs-on: ubuntu-18.04 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} strategy: fail-fast: false matrix: - pair: - - erlang: 23.1 - elixir: 1.11.1 - - erlang: 22.2 - elixir: 1.11.1 - - erlang: 21.3 - elixir: 1.11.1 - - erlang: 22.2 - elixir: 1.10.4 - - erlang: 21.3 - elixir: 1.9.4 - - erlang: 21.3 - elixir: 1.8.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + include: + - pair: + elixir: 1.8.2 + otp: 21.3 + - pair: + elixir: 1.9.4 + otp: 21.3 + - pair: + elixir: 1.10.4 + otp: 21.3 + - pair: + elixir: 1.11.3 + otp: 22.2 + - pair: + elixir: 1.12.3 + otp: 23.2.5 + - pair: + elixir: 1.12.3 + otp: 24.1.3 + lint: lint steps: - uses: actions/checkout@v2 - - name: Set up Elixir - uses: erlef/setup-elixir@v1 + - uses: erlef/setup-elixir@v1 with: - otp-version: ${{matrix.pair.erlang}} + otp-version: ${{matrix.pair.otp}} elixir-version: ${{matrix.pair.elixir}} - - name: Install dependencies - run: | - mix local.hex --force - mix local.rebar --force - mix deps.get + - name: Install Dependencies + run: mix deps.get + + - run: mix format --check-formatted + if: ${{ matrix.lint }} + + - run: mix deps.get && mix deps.unlock --check-unused + if: ${{ matrix.lint }} + + - run: mix deps.compile + + - run: mix compile --warnings-as-errors + if: ${{ matrix.lint }} - - name: Run tests - run: MIX_ENV=test mix coveralls.github + - run: MIX_ENV=test mix coveralls.github - name: Retrieve PLT Cache uses: actions/cache@v1 id: plt-cache with: path: priv/plts - key: ${{ runner.os }}-${{ matrix.pair.erlang }}-${{ matrix.pair.elixir }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} + key: ${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-plts-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} - name: Create PLTs if: steps.plt-cache.outputs.cache-hit != 'true'