update packages, deprecations, devcontainer and make formatter happy #2056
Workflow file for this run
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
name: CI | |
on: [push, pull_request] | |
jobs: | |
build: | |
name: Build and test | |
runs-on: ${{ matrix.os }} | |
services: | |
postgres: | |
image: postgres:12.2 | |
env: | |
POSTGRES_USER: admin | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: dev | |
ports: | |
- 5432:5432 | |
mariadb: | |
image: mariadb:10.3 | |
env: | |
MYSQL_USER: admin | |
MYSQL_PASSWORD: password | |
MYSQL_DATABASE: dev | |
MYSQL_RANDOM_ROOT_PASSWORD: "yes" | |
ports: | |
- 3306:3306 | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
ocaml-compiler: | |
- 4.12.x | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Use OCaml ${{ matrix.ocaml-version }} | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
dune-cache: true | |
- name: Install system dependencies | |
run: sudo apt-get update -y && sudo apt-get install -y libmariadb-dev | |
- name: Install dependencies | |
run: make deps | |
- name: Build | |
run: make build | |
- name: Check formatting | |
run: make format | |
- name: Run tests | |
run: make test-all | |
- name: Pin current Sihl | |
run: opam pin add sihl . | |
- name: Generate PostgreSQL model | |
run: | | |
cd template | |
ROOT_PATH=. LOGS_DIR=. make sihl gen.model postgresql employee title:string is_premium:bool age:int shipped_at:datetime | |
DATABASE_URL=postgres://admin:password@127.0.0.1:5432/dev ENV_FILES_PATH=. ROOT_PATH=. LOGS_DIR=. make test | |
- name: Generate MariaDB model | |
run: | | |
cd template | |
rm -r app/domain/employee database/employee.ml test/employee | |
ROOT_PATH=. LOGS_DIR=. make sihl gen.model mariadb employee title:string is_premium:bool age:int shipped_at:datetime | |
echo "module Migration = Sihl.Database.Migration.MariaDb" > service/service.ml | |
echo "(executable (name run) (libraries sihl service routes database schedule command caqti-driver-mariadb))" > run/dune | |
opam install caqti-driver-mariadb | |
DATABASE_URL=mariadb://admin:password@127.0.0.1:3306/dev ENV_FILES_PATH=. ROOT_PATH=. LOGS_DIR=. make test |