setup elixir versions matrix in continuous integration #332
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Continuous Integration | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| static_code_analysis: | |
| name: Static Code Analysis | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| matrix: | |
| container: | |
| - elixir:1.14.5-otp-25 | |
| - elixir:1.19.3-otp-26 | |
| container: | |
| image: ${{ matrix.container }} | |
| steps: | |
| - name: Cancel Previous Runs | |
| uses: styfle/cancel-workflow-action@0.11.0 | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| # - name: Check Code Format | |
| # run: mix format --check-formatted | |
| - name: Copy mix lockfile | |
| run: | | |
| cp mix.lock.test mix.lock | |
| - name: Elixir prerequisites | |
| run: | | |
| mix local.rebar --force | |
| mix local.hex --force | |
| mix deps.get | |
| - name: Compilation warnings | |
| run: mix compile --force --warnings-as-errors | |
| - name: Run Credo | |
| run: mix credo --strict | |
| - name: Run Dialyzer | |
| run: mix dialyzer | |
| unit_tests: | |
| name: Unit Tests | |
| runs-on: ubuntu-22.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| container: | |
| - elixir:1.14.5-otp-25 | |
| - elixir:1.19.3-otp-25 | |
| container: | |
| image: ${{ matrix.container }} | |
| services: | |
| postgres: | |
| image: postgres | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Cancel Previous Runs | |
| uses: styfle/cancel-workflow-action@0.6.0 | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Copy mix lockfile | |
| run: | | |
| cp mix.lock.test mix.lock | |
| - name: Elixir prerequisites | |
| run: | | |
| mix local.rebar --force | |
| mix local.hex --force | |
| mix deps.get | |
| - name: Run test | |
| run: mix coveralls.github --trace | |
| env: | |
| COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | |
| DID_SERVICES_API_KEY: ${{ secrets.DID_SERVICES_API_KEY }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| MIX_ENV: test | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DATABASE: boruta_test | |
| POSTGRES_HOST: postgres |