-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (52 loc) · 1.5 KB
/
test-build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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: "1"
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