Test #1
This file contains 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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Elixir CI | |
on: [push, pull_request] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: Build and test | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
pair: | |
- elixir: 1.15 | |
otp: 26.2 | |
- elixir: 1.14 | |
otp: 25.3 | |
- elixir: 1.13 | |
otp: 24.3 | |
- elixir: 1.12 | |
otp: 23.3 | |
- elixir: 1.11 | |
otp: 22.3 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@61e01a43a562a89bfc54c7f9a378ff67b03e4a21 # v1.16.0 | |
with: | |
elixir-version: ${{ matrix.pair.elixir }} # [Required] Define the Elixir version | |
otp-version: ${{ matrix.pair.otp }} # [Required] Define the Erlang/OTP version | |
- name: Restore dependencies cache | |
uses: actions/cache@v3 | |
with: | |
path: deps | |
key: ${{ runner.os }}-${{ matrix.pair.otp }}-${{ matrix.pair.elixir }}-mix-${{ hashFiles('**/mix.lock') }} | |
restore-keys: ${{ runner.os }}-mix- | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Run tests | |
run: mix test test --cover | |
- name: Verify version | |
run: | | |
mix run -e "if(Testcontainers.Constants.library_version() == Mix.Project.config()[:version], do: IO.puts("OK"), else: System.halt(\"version mismatch\"))" | |
test_examples: | |
name: Test example projects | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Elixir | |
uses: erlef/setup-beam@61e01a43a562a89bfc54c7f9a378ff67b03e4a21 # v1.16.0 | |
with: | |
elixir-version: '1.15.2' # [Required] Define the Elixir version | |
otp-version: '26.0' # [Required] Define the Erlang/OTP version | |
- name: Run example phoenix project tests | |
run: | | |
cd examples/phoenix_project | |
mix deps.get | |
mix test | |
MIX_ENV=prod mix release | |
- name: Run example mix project tests | |
run: | | |
cd examples/mix_project | |
mix deps.get | |
mix test |