2019-11-23 03:48:20 +00:00
|
|
|
name: CI
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches: master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Test (${{matrix.elixir}}/${{matrix.otp}})
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-12-07 03:58:10 +00:00
|
|
|
otp: [21.x, 22.x, 23.x]
|
|
|
|
elixir: [1.7.x, 1.8.x, 1.9.x, 1.10.x, 1.11.x]
|
2019-11-23 03:48:20 +00:00
|
|
|
|
|
|
|
steps:
|
2020-04-09 02:58:01 +00:00
|
|
|
- uses: actions/checkout@v2
|
2020-12-07 03:58:10 +00:00
|
|
|
- uses: actions/setup-elixir@v1.5.0
|
2019-11-23 03:48:20 +00:00
|
|
|
with:
|
|
|
|
otp-version: ${{matrix.otp}}
|
|
|
|
elixir-version: ${{matrix.elixir}}
|
|
|
|
- uses: actions/cache@v1
|
|
|
|
id: cache
|
|
|
|
with:
|
|
|
|
path: deps
|
2020-06-16 19:28:21 +00:00
|
|
|
key: ${{ runner.os }}-test-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
|
|
|
|
restore-keys:
|
|
|
|
- name: Install Dependencies
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: mix deps.get
|
|
|
|
|
|
|
|
- name: Run Tests
|
|
|
|
run: mix test
|
|
|
|
|
|
|
|
integration_tests:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: Integration Test (${{matrix.elixir}}/${{matrix.otp}})
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: "./integration_test/temple_demo"
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-12-07 03:58:10 +00:00
|
|
|
otp: [21.x, 22.x, 23.x]
|
|
|
|
elixir: [1.7.x, 1.8.x, 1.9.x, 1.10.x, 1.11.x]
|
2020-06-16 19:28:21 +00:00
|
|
|
|
|
|
|
services:
|
|
|
|
db:
|
|
|
|
image: postgres:12
|
|
|
|
env:
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
POSTGRES_DB: temple_demo_test
|
|
|
|
ports: ['5432:5432']
|
|
|
|
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-12-07 03:58:10 +00:00
|
|
|
- uses: actions/setup-elixir@v1.5.0
|
2020-06-16 19:28:21 +00:00
|
|
|
with:
|
|
|
|
otp-version: ${{matrix.otp}}
|
|
|
|
elixir-version: ${{matrix.elixir}}
|
2020-07-24 01:17:11 +00:00
|
|
|
|
2020-06-16 19:28:21 +00:00
|
|
|
- uses: actions/cache@v1
|
|
|
|
id: cache
|
|
|
|
with:
|
|
|
|
path: deps
|
|
|
|
key: ${{ runner.os }}-integration-test-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/integration_test/temple_demo/mix.lock')) }}
|
2019-11-23 03:48:20 +00:00
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: mix deps.get
|
|
|
|
|
|
|
|
- name: Run Tests
|
2020-07-24 01:17:11 +00:00
|
|
|
run: mix test || mix test --failed || mix test --failed
|
2020-06-16 19:28:21 +00:00
|
|
|
env:
|
|
|
|
MIX_ENV: test
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
if: failure()
|
|
|
|
with:
|
|
|
|
name: screenshots
|
|
|
|
path: screenshots/
|
2019-11-23 03:48:20 +00:00
|
|
|
|
|
|
|
formatter:
|
|
|
|
runs-on: ubuntu-latest
|
2020-12-07 03:58:10 +00:00
|
|
|
name: Formatter (1.11.x/21.x)
|
2019-11-23 03:48:20 +00:00
|
|
|
|
|
|
|
steps:
|
2020-04-09 02:58:01 +00:00
|
|
|
- uses: actions/checkout@v2
|
2020-04-09 03:11:28 +00:00
|
|
|
- uses: actions/setup-elixir@v1.2.0
|
2019-11-23 03:48:20 +00:00
|
|
|
with:
|
|
|
|
otp-version: 21.x
|
2020-12-07 03:58:10 +00:00
|
|
|
elixir-version: 1.11.x
|
2019-11-23 03:48:20 +00:00
|
|
|
- uses: actions/cache@v1
|
|
|
|
id: cache
|
|
|
|
with:
|
|
|
|
path: deps
|
2020-04-09 02:58:01 +00:00
|
|
|
key: ${{ runner.os }}-${{ matrix.elixir }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
|
2019-11-23 03:48:20 +00:00
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-mix-
|
|
|
|
|
|
|
|
- name: Install Dependencies
|
|
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
|
|
run: mix deps.get
|
|
|
|
|
|
|
|
- name: Run Formatter
|
|
|
|
run: mix format --check-formatted
|