2021-05-01 12:38:16 +00:00
|
|
|
name: Tests
|
2021-01-07 11:49:55 +00:00
|
|
|
on:
|
|
|
|
push:
|
2021-03-14 18:03:30 +00:00
|
|
|
branches:
|
|
|
|
- main
|
2021-01-07 11:49:55 +00:00
|
|
|
pull_request:
|
2021-03-14 18:03:30 +00:00
|
|
|
branches:
|
|
|
|
- main
|
2021-01-07 11:49:55 +00:00
|
|
|
|
|
|
|
jobs:
|
2021-11-25 01:50:02 +00:00
|
|
|
test_classic_flavour:
|
2021-11-25 01:52:44 +00:00
|
|
|
name: Test classic flavour
|
2021-01-07 11:49:55 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: elixir:alpine
|
2021-06-10 17:11:23 +00:00
|
|
|
env:
|
2021-11-25 01:50:02 +00:00
|
|
|
FLAVOUR: classic
|
2021-11-25 02:21:03 +00:00
|
|
|
MIX_ENV: test
|
2021-06-10 17:11:23 +00:00
|
|
|
POSTGRES_HOST: postgres
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
CI: true
|
2021-07-13 08:56:10 +00:00
|
|
|
SECRET_KEY_BASE: "kSNSvYkWk14onNdbYzhEqFyG5TzpOO9+FFlk5sIrhTk0RV6+FeL/nM8DWQffDah4woepgQdrP6J8cjWGyehcWcRWvIIWXsghp0yY9/fEjgfUekD15P9LGRCmu6exIQ6g"
|
|
|
|
SIGNING_SALT: "NPkqpeTx/q9xGQRWwRpqBWI7bCxeHMAF4L2PHntfjVtd8GZD2BQKe9KLnkIR5WbLVdZt24FWuR+Hy5WoXaZM4APydGvC2+w2enJmskOckX5VY1Bpvm7JGKu+QymgIgK/"
|
|
|
|
ENCRYPTION_SALT: "l+QT/gkdX722f57qSAUc+bZcqm5ZduXY4D0hp0glEiKdR267JsZ1/CZlrlhADcD8kzuaZGFWvJ2dlr6sujbzGQV5e04lKVIsZh3gfd8eqQBckIqH6L8TDRRz4M07YE+F"
|
2021-01-07 11:49:55 +00:00
|
|
|
services:
|
|
|
|
postgres:
|
2021-12-12 18:44:34 +00:00
|
|
|
image: postgres:12-alpine
|
2021-01-07 11:49:55 +00:00
|
|
|
env:
|
2021-06-10 17:34:16 +00:00
|
|
|
POSTGRES_DB: bonfire_test
|
2021-01-07 11:49:55 +00:00
|
|
|
POSTGRES_PASSWORD: postgres
|
2021-06-10 17:34:16 +00:00
|
|
|
ports:
|
|
|
|
- 5432:5432
|
2021-01-07 11:49:55 +00:00
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
steps:
|
2021-05-01 12:54:11 +00:00
|
|
|
-
|
|
|
|
name: Cancel Previous Runs
|
|
|
|
uses: styfle/cancel-workflow-action@0.9.0
|
|
|
|
with:
|
|
|
|
access_token: ${{ github.token }}
|
|
|
|
-
|
2021-06-10 18:46:41 +00:00
|
|
|
name: Install git (needed for checkout), tar (needed for cache), file (needed for bonfire_files)
|
|
|
|
run: apk add git tar file
|
2021-05-01 12:54:11 +00:00
|
|
|
-
|
|
|
|
name: Checkout repo
|
2021-04-17 19:51:10 +00:00
|
|
|
uses: actions/checkout@v2
|
2021-04-17 10:38:53 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 2 # needed for action-detect-and-tag-new-version
|
2021-01-07 11:49:55 +00:00
|
|
|
# - name: Set up Elixir
|
|
|
|
# uses: actions/setup-elixir@v1
|
|
|
|
# with:
|
|
|
|
# elixir-version: ${{ matrix.elixir }}
|
|
|
|
# otp-version: ${{ matrix.otp }}
|
|
|
|
# TODO: does not handle git deps correctly...
|
2021-11-25 01:50:02 +00:00
|
|
|
- name: Restore dependencies cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: cache
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
deps
|
|
|
|
_build
|
|
|
|
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
|
|
|
|
restore-keys: ${{ runner.os }}-mix-
|
|
|
|
- name: Install system deps
|
|
|
|
run: apk add mailcap ca-certificates openssl-dev tzdata gettext rust cargo make
|
|
|
|
- name: Install hex
|
|
|
|
run: mix local.hex --force
|
|
|
|
- name: Install rebar
|
|
|
|
run: mix local.rebar --force
|
|
|
|
- name: Install dependencies
|
|
|
|
run: mix deps.get
|
|
|
|
- name: Update Bonfire extensions to latest git versions
|
|
|
|
run: mix bonfire.deps.update
|
|
|
|
- name: Fetch any differences in dep version
|
|
|
|
run: mix deps.get
|
|
|
|
- name: Clean-build Bonfire data extensions
|
|
|
|
run: mix bonfire.deps.clean
|
|
|
|
- name: Compile deps & app
|
2021-11-25 02:21:03 +00:00
|
|
|
run: mix
|
2021-11-25 01:50:02 +00:00
|
|
|
- name: Set up database
|
2021-11-25 02:21:03 +00:00
|
|
|
run: mix ecto.setup
|
2021-11-25 01:50:02 +00:00
|
|
|
- name: Check that database migrations can rollback
|
2021-11-25 02:21:03 +00:00
|
|
|
run: mix ecto.rollback --all && mix ecto.migrate
|
2021-11-25 01:50:02 +00:00
|
|
|
- name: Run tests
|
|
|
|
run: mix test
|
|
|
|
|
|
|
|
test_cooperation_flavour:
|
2021-12-12 21:25:43 +00:00
|
|
|
name: Test cooperation flavour
|
2021-11-25 01:50:02 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
container: elixir:alpine
|
|
|
|
env:
|
|
|
|
FLAVOUR: cooperation
|
2021-11-25 02:21:03 +00:00
|
|
|
MIX_ENV: test
|
2021-11-25 01:50:02 +00:00
|
|
|
POSTGRES_HOST: postgres
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
CI: true
|
|
|
|
SECRET_KEY_BASE: "kSNSvYkWk14onNdbYzhEqFyG5TzpOO9+FFlk5sIrhTk0RV6+FeL/nM8DWQffDah4woepgQdrP6J8cjWGyehcWcRWvIIWXsghp0yY9/fEjgfUekD15P9LGRCmu6exIQ6g"
|
|
|
|
SIGNING_SALT: "NPkqpeTx/q9xGQRWwRpqBWI7bCxeHMAF4L2PHntfjVtd8GZD2BQKe9KLnkIR5WbLVdZt24FWuR+Hy5WoXaZM4APydGvC2+w2enJmskOckX5VY1Bpvm7JGKu+QymgIgK/"
|
|
|
|
ENCRYPTION_SALT: "l+QT/gkdX722f57qSAUc+bZcqm5ZduXY4D0hp0glEiKdR267JsZ1/CZlrlhADcD8kzuaZGFWvJ2dlr6sujbzGQV5e04lKVIsZh3gfd8eqQBckIqH6L8TDRRz4M07YE+F"
|
|
|
|
services:
|
|
|
|
postgres:
|
|
|
|
# image: postgres
|
2021-12-12 18:44:34 +00:00
|
|
|
image: postgis/postgis:12-3.1-alpine
|
2021-11-25 01:50:02 +00:00
|
|
|
env:
|
|
|
|
POSTGRES_DB: bonfire_test
|
|
|
|
POSTGRES_PASSWORD: postgres
|
|
|
|
ports:
|
|
|
|
- 5432:5432
|
|
|
|
options: >-
|
|
|
|
--health-cmd pg_isready
|
|
|
|
--health-interval 10s
|
|
|
|
--health-timeout 5s
|
|
|
|
--health-retries 5
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Install git (needed for checkout), tar (needed for cache), file (needed for bonfire_files)
|
|
|
|
run: apk add git tar file
|
|
|
|
-
|
|
|
|
name: Checkout repo
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 2 # needed for action-detect-and-tag-new-version
|
|
|
|
# - name: Set up Elixir
|
|
|
|
# uses: actions/setup-elixir@v1
|
|
|
|
# with:
|
|
|
|
# elixir-version: ${{ matrix.elixir }}
|
|
|
|
# otp-version: ${{ matrix.otp }}
|
|
|
|
# TODO: does not handle git deps correctly...
|
2021-04-20 14:42:24 +00:00
|
|
|
- name: Restore dependencies cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: cache
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
deps
|
|
|
|
_build
|
|
|
|
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
|
|
|
|
restore-keys: ${{ runner.os }}-mix-
|
2021-04-15 16:48:24 +00:00
|
|
|
- name: Install system deps
|
2021-04-20 11:34:46 +00:00
|
|
|
run: apk add mailcap ca-certificates openssl-dev tzdata gettext rust cargo make
|
2021-01-07 11:49:55 +00:00
|
|
|
- name: Install hex
|
|
|
|
run: mix local.hex --force
|
|
|
|
- name: Install rebar
|
|
|
|
run: mix local.rebar --force
|
2021-05-05 19:11:12 +00:00
|
|
|
- name: Install dependencies
|
|
|
|
run: mix deps.get
|
2021-04-29 10:22:56 +00:00
|
|
|
- name: Update Bonfire extensions to latest git versions
|
|
|
|
run: mix bonfire.deps.update
|
2021-05-13 11:09:39 +00:00
|
|
|
- name: Fetch any differences in dep version
|
|
|
|
run: mix deps.get
|
2021-11-19 00:48:15 +00:00
|
|
|
- name: Clean-build Bonfire data extensions
|
2021-04-20 14:42:24 +00:00
|
|
|
run: mix bonfire.deps.clean
|
2021-03-15 11:28:33 +00:00
|
|
|
- name: Compile deps & app
|
2021-11-25 02:21:03 +00:00
|
|
|
run: mix
|
2021-04-04 11:14:09 +00:00
|
|
|
- name: Set up database
|
2021-11-25 02:21:03 +00:00
|
|
|
run: mix ecto.setup
|
2021-11-19 00:48:15 +00:00
|
|
|
- name: Generate docs
|
2021-11-25 02:21:03 +00:00
|
|
|
run: mix docs
|
2021-11-19 00:48:15 +00:00
|
|
|
- name: Deploy docs
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
publish_dir: ./docs/exdoc
|
2021-11-25 01:50:02 +00:00
|
|
|
cname: doc.bonfirenetworks.org
|
|
|
|
- name: Check that database migrations can rollback
|
2021-11-25 02:21:03 +00:00
|
|
|
run: mix ecto.rollback --all && mix ecto.migrate
|
2021-01-07 11:49:55 +00:00
|
|
|
- name: Run tests
|
|
|
|
run: mix test
|