CI workflows #12
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: test-build | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize] | |
branches: | |
- "16.0" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
uses: ./.github/workflows/build-and-push.yml | |
with: | |
tags: ghcr.io/${{ github.repository_owner }}/curq-ci:pr-${{ github.event.pull_request.number }} | |
target: "ci" | |
test: | |
runs-on: ubuntu-22.04 | |
needs: [build] | |
container: | |
image: ghcr.io/${{ github.repository_owner }}/curq-ci:pr-${{ github.event.pull_request.number }} | |
services: | |
postgres: | |
image: postgres:13.0 | |
env: | |
POSTGRES_USER: odoo | |
POSTGRES_PASSWORD: odoo | |
POSTGRES_DB: odoo | |
ports: | |
- 5432:5432 | |
env: | |
DB_HOST: postgres | |
DB_PORT: "5432" | |
DB_USER: odoo | |
DB_PASSWORD: odoo | |
WORKERS: "0" | |
DOCKER: "true" | |
steps: | |
- name: Create config file | |
run: | | |
create_config_file.sh | |
- name: Wait for PostgreSQL | |
run: | | |
wait_for_postgres.sh | |
- name: Initialize test db | |
run: | | |
ADDONS=$(manifestoo -d /odoo/custom list | grep _install | paste -sd,) | |
unbuffer odoo -d odoo -i $ADDONS --stop-after-init | checklog-odoo -i WARNING | |
- name: Run tests | |
run: | | |
ADDONS=$(manifestoo -d /odoo/custom --separator , list) | |
unbuffer odoo -d odoo -u $ADDONS --test-enable --stop-after-init | checklog-odoo -i WARNING |