Skip to content

Commit 4776d9f

Browse files
committed
WIP CI build
1 parent 9464ce8 commit 4776d9f

File tree

6 files changed

+70
-105
lines changed

6 files changed

+70
-105
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: clean-test-build
2+
on:
3+
pull_request:
4+
types: [closed]
5+
6+
jobs:
7+
clean:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: bots-house/ghcr-delete-image-action@v1.1.0
11+
with:
12+
owner: ${{ github.repository_owner }}
13+
name: curq-ci
14+
token: ${{ secrets.PAT }}
15+
tag: pr-${{ github.event.pull_request.number }}

.github/workflows/pre-commit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: pre-commit
33
on:
44
pull_request:
55
branches:
6-
- "16.0*"
6+
- "16.0"
77
push:
88
branches:
99
- "16.0"
File renamed without changes.

.github/workflows/test-build.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: test-build
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, synchronize]
6+
branches:
7+
- "16.0"
8+
jobs:
9+
build:
10+
uses: ./.github/workflows/build-and-push.yml
11+
with:
12+
tags: ghcr.io/${{ github.repository_owner }}/curq-ci:pr-${{ github.event.pull_request.number }}
13+
target: "ci"
14+
test:
15+
runs-on: ubuntu-22.04
16+
container:
17+
image: ghcr.io/${{ github.repository_owner }}/curq-ci:pr-${{ github.event.pull_request.number }}
18+
services:
19+
postgres:
20+
image: postgres:13.0
21+
env:
22+
POSTGRES_USER: odoo
23+
POSTGRES_PASSWORD: odoo
24+
POSTGRES_DB: odoo
25+
ports:
26+
- 5432:5432
27+
env:
28+
DB_HOST: postgres
29+
DB_USER: odoo
30+
DB_PASSWORD: odoo
31+
WORKERS: "1"
32+
DOCKER: "true"
33+
steps:
34+
- name: Create config file
35+
run: |
36+
create_config_file.sh
37+
- name: Wait for PostgreSQL
38+
run: |
39+
wait_for_postgres.sh
40+
- name: Initialize test db
41+
run: |
42+
ADDONS=$(manifestoo -d /odoo/custom list | grep _install | paste -sd,)
43+
unbuffer odoo -d odoo -i $ADDONS --stop-after-init | checklog-odoo
44+
- name: Run tests
45+
run: |
46+
ADDONS=$(manifestoo -d /odoo/custom --separator , list)
47+
unbuffer coverage run odoo -d odoo -u $ADDONS --test-enable --stop-after-init | checklog-odoo
48+
- name: Upload coverage reports to Codecov
49+
uses: codecov/codecov-action@v3
50+
with:
51+
files: ./coverage.xml
52+
env:
53+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/tests.yml

-103
This file was deleted.

Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ COPY requirements.txt /curq-requirements.txt
6969
RUN apt-get update && apt-get -y install python3-pip cython3 python3 libldap2-dev libpq-dev libsasl2-dev python3-requests
7070
RUN pip wheel -r /requirements.txt -r /curq-requirements.txt --wheel-dir=/wheels
7171

72-
FROM ghcr.io/onesteinbv/odoo-docker:db5abc7fbd2915dd7b7dd63b16d3aa7cdb805f12 as base
72+
FROM ghcr.io/onesteinbv/odoo-docker:19df7a6678c475d91eefbb5c0f8d0c3a1db6197d as base
7373
COPY --from=pack ./odoo /odoo/src/odoo
7474
COPY --from=pack ./package /odoo/custom
7575
COPY --from=wheels ./wheels /odoo/wheels

0 commit comments

Comments
 (0)