mirror of
https://github.com/bonfire-networks/bonfire-app.git
synced 2024-05-18 00:52:40 +00:00
Update test CI.
This commit is contained in:
parent
31c3ac9cf6
commit
52854614d8
173
.github/workflows/test.yaml
vendored
173
.github/workflows/test.yaml
vendored
|
@ -2,63 +2,56 @@ name: Test
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test_classic_flavour:
|
test:
|
||||||
name: Test classic flavour
|
runs-on: ubuntu-22.04
|
||||||
runs-on: ubuntu-latest
|
name: Flavour ${{matrix.flavour}} / OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
|
||||||
container: hexpm/elixir:1.16.1-erlang-26.2.2-alpine-3.19.1
|
strategy:
|
||||||
|
matrix:
|
||||||
|
flavour: ['classic', 'cooperation']
|
||||||
|
otp: ['26.2']
|
||||||
|
elixir: ['1.16']
|
||||||
env:
|
env:
|
||||||
FLAVOUR: classic
|
FLAVOUR: ${{matrix.flavour}}
|
||||||
MIX_ENV: test
|
MIX_ENV: test
|
||||||
WITH_DOCKER: no
|
WITH_DOCKER: partial
|
||||||
POSTGRES_HOST: postgres
|
|
||||||
POSTGRES_PASSWORD: postgres
|
|
||||||
CI: true
|
CI: true
|
||||||
TEST_LOG_TRUNCATE: 340
|
TEST_LOG_TRUNCATE: 340
|
||||||
TEST_LOG_LEVEL: error
|
TEST_LOG_LEVEL: error
|
||||||
SECRET_KEY_BASE: "kSNSvYkWk14onNdbYzhEqFyG5TzpOO9+FFlk5sIrhTk0RV6+FeL/nM8DWQffDah4woepgQdrP6J8cjWGyehcWcRWvIIWXsghp0yY9/fEjgfUekD15P9LGRCmu6exIQ6g"
|
SECRET_KEY_BASE: "kSNSvYkWk14onNdbYzhEqFyG5TzpOO9+FFlk5sIrhTk0RV6+FeL/nM8DWQffDah4woepgQdrP6J8cjWGyehcWcRWvIIWXsghp0yY9/fEjgfUekD15P9LGRCmu6exIQ6g"
|
||||||
SIGNING_SALT: "NPkqpeTx/q9xGQRWwRpqBWI7bCxeHMAF4L2PHntfjVtd8GZD2BQKe9KLnkIR5WbLVdZt24FWuR+Hy5WoXaZM4APydGvC2+w2enJmskOckX5VY1Bpvm7JGKu+QymgIgK/"
|
SIGNING_SALT: "NPkqpeTx/q9xGQRWwRpqBWI7bCxeHMAF4L2PHntfjVtd8GZD2BQKe9KLnkIR5WbLVdZt24FWuR+Hy5WoXaZM4APydGvC2+w2enJmskOckX5VY1Bpvm7JGKu+QymgIgK/"
|
||||||
ENCRYPTION_SALT: "l+QT/gkdX722f57qSAUc+bZcqm5ZduXY4D0hp0glEiKdR267JsZ1/CZlrlhADcD8kzuaZGFWvJ2dlr6sujbzGQV5e04lKVIsZh3gfd8eqQBckIqH6L8TDRRz4M07YE+F"
|
ENCRYPTION_SALT: "l+QT/gkdX722f57qSAUc+bZcqm5ZduXY4D0hp0glEiKdR267JsZ1/CZlrlhADcD8kzuaZGFWvJ2dlr6sujbzGQV5e04lKVIsZh3gfd8eqQBckIqH6L8TDRRz4M07YE+F"
|
||||||
services:
|
|
||||||
postgres:
|
|
||||||
image: postgis/postgis:12-3.3-alpine
|
|
||||||
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:
|
steps:
|
||||||
-
|
- name: Cancel Previous Runs
|
||||||
name: Cancel Previous Runs
|
|
||||||
uses: styfle/cancel-workflow-action@0.9.0
|
uses: styfle/cancel-workflow-action@0.9.0
|
||||||
with:
|
with:
|
||||||
access_token: ${{ github.token }}
|
access_token: ${{ github.token }}
|
||||||
-
|
- name: Add system repositories
|
||||||
name: Install bash (needed for just), git (needed for checkout), tar (needed for cache), file (needed for bonfire_files), make/build-base/sqlite (for arch), and just
|
run: |
|
||||||
run: apk add bash git tar file make build-base sqlite just
|
sudo apt update
|
||||||
-
|
sudo apt install ca-certificates curl
|
||||||
name: Checkout repo
|
sudo install -m 0755 -d /etc/apt/keyrings
|
||||||
uses: actions/checkout@v2
|
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
||||||
|
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
||||||
|
|
||||||
|
echo \
|
||||||
|
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
|
||||||
|
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
|
||||||
|
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
||||||
|
|
||||||
|
sudo apt update
|
||||||
|
- name: Install system deps
|
||||||
|
run: sudo apt install git tar file make build-essential sqlite docker-compose-plugin && sudo snap install --edge just --classic
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: erlef/setup-beam@v1
|
||||||
with:
|
with:
|
||||||
fetch-depth: 2 # needed for action-detect-and-tag-new-version
|
otp-version: ${{matrix.otp}}
|
||||||
# - name: Set up Elixir
|
elixir-version: ${{matrix.elixir}}
|
||||||
# uses: actions/setup-elixir@v1
|
|
||||||
# with:
|
|
||||||
# elixir-version: ${{ matrix.elixir }}
|
|
||||||
# otp-version: ${{ matrix.otp }}
|
|
||||||
# TODO: does not handle git deps correctly?...
|
|
||||||
- name: Trust my repo
|
|
||||||
run: export GIT_CEILING_DIRECTORIES=/__w && git config --global --add safe.directory /__w/bonfire-app/bonfire-app # see https://github.com/actions/checkout/issues/760
|
|
||||||
- name: Restore dependencies cache
|
- name: Restore dependencies cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
id: cache
|
id: cache
|
||||||
|
@ -68,107 +61,13 @@ jobs:
|
||||||
_build
|
_build
|
||||||
key: ${{ runner.os }}-mix-${{ hashFiles('/mix.lock') }}
|
key: ${{ runner.os }}-mix-${{ hashFiles('/mix.lock') }}
|
||||||
restore-keys: ${{ runner.os }}-mix-
|
restore-keys: ${{ runner.os }}-mix-
|
||||||
- name: Install system deps
|
|
||||||
run: apk add mailcap ca-certificates openssl-dev tzdata gettext rust cargo sqlite
|
|
||||||
# - name: Install tools
|
|
||||||
# run: cargo install just && echo "/github/home/.cargo/bin" >> $GITHUB_PATH
|
|
||||||
- name: Install hex
|
- name: Install hex
|
||||||
run: mix local.hex --force
|
run: mix local.hex --force
|
||||||
- name: Install rebar
|
- name: Install rebar
|
||||||
run: mix local.rebar --force
|
run: mix local.rebar --force
|
||||||
# - name: Remove mix.lock
|
|
||||||
# run: rm mix.lock
|
|
||||||
- name: Prepare environment
|
- name: Prepare environment
|
||||||
run: just pre-setup && just init
|
run: just config && just setup-dev
|
||||||
- name: Install dependencies
|
|
||||||
run: mix deps.get
|
|
||||||
- name: Update Bonfire extensions to latest git versions (just use lockfile in future?)
|
|
||||||
run: mix bonfire.deps.update
|
|
||||||
- name: Fetch any differences in nested deps (+ run post-install setup)
|
|
||||||
run: just deps-get && just pre-init
|
|
||||||
# - name: Clean-build Bonfire data extensions
|
|
||||||
# run: mix bonfire.deps.clean.data
|
|
||||||
- name: Compile deps & app
|
|
||||||
run: mix compile
|
|
||||||
- name: Set up database
|
|
||||||
run: mix ecto.create && mix ecto.migrate
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: mix test
|
run: just test
|
||||||
- name: Check database down migrations
|
- name: Check database down migrations
|
||||||
run: mix ecto.rollback --all
|
run: just db-rollback-all
|
||||||
|
|
||||||
# test_cooperation_flavour:
|
|
||||||
# name: Test cooperation flavour
|
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
# container: hexpm/elixir:1.15.0-erlang-26.0.1-alpine-3.18.2
|
|
||||||
# env:
|
|
||||||
# FLAVOUR: cooperation
|
|
||||||
# MIX_ENV: test
|
|
||||||
# WITH_DOCKER: no
|
|
||||||
# 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
|
|
||||||
# image: postgis/postgis:12-3.3-alpine
|
|
||||||
# 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 }}
|
|
||||||
# - name: Restore dependencies cache
|
|
||||||
# uses: actions/cache@v2
|
|
||||||
# id: cache
|
|
||||||
# with:
|
|
||||||
# path: |
|
|
||||||
# deps
|
|
||||||
# _build
|
|
||||||
# key: ${{ runner.os }}-mix-${{ hashFiles('/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: Prepare environment
|
|
||||||
# run: make pre-run
|
|
||||||
# - 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 nested deps
|
|
||||||
# run: mix deps.get
|
|
||||||
# - name: Clean-build Bonfire data extensions
|
|
||||||
# run: mix bonfire.deps.clean.data
|
|
||||||
# - name: Compile deps & app
|
|
||||||
# run: mix compile
|
|
||||||
# - name: Set up database
|
|
||||||
# run: mix ecto.setup
|
|
||||||
# - name: Run tests
|
|
||||||
# run: mix test
|
|
||||||
# - name: Check database down migrations
|
|
||||||
# run: mix ecto.rollback --all
|
|
||||||
|
|
0
js-deps-get.sh
Normal file → Executable file
0
js-deps-get.sh
Normal file → Executable file
Loading…
Reference in a new issue