Skip to content

Commit 5990ef7

Browse files
committed
Add CI migration test workflow
1 parent 8f49cf9 commit 5990ef7

File tree

3 files changed

+53
-3
lines changed

3 files changed

+53
-3
lines changed

.github/workflows/release-build.yml

+7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ jobs:
1212
with:
1313
tags: ghcr.io/${{ github.repository_owner }}/curq:latest,ghcr.io/${{ github.repository_owner }}/curq:${{ github.ref_name }},ghcr.io/${{ github.repository_owner }}/curq:16.0
1414

15+
build-and-pus-ci:
16+
uses: ./.github/workflows/build-and-push.yml
17+
if: startsWith(github.ref_name, '16.0.')
18+
with:
19+
tags: ghcr.io/${{ github.repository_owner }}/curq-ci:latest,ghcr.io/${{ github.repository_owner }}/curq-ci:${{ github.ref_name }},ghcr.io/${{ github.repository_owner }}/curq-ci:16.0
20+
target: ci
21+
1522
release:
1623
needs: build-and-push
1724
runs-on: ubuntu-latest

.github/workflows/test-build.yml

+44-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
test:
2222
runs-on: ubuntu-22.04
2323
needs: [build]
24-
container:
24+
container:
2525
image: ghcr.io/${{ github.repository_owner }}/curq-ci:pr-${{ github.event.pull_request.number }}
2626
services:
2727
postgres:
@@ -55,3 +55,46 @@ jobs:
5555
run: |
5656
ADDONS=$(manifestoo -d /odoo/custom --separator , list)
5757
unbuffer odoo -d odoo -u $ADDONS --test-enable --stop-after-init | checklog-odoo -i WARNING
58+
migration-test:
59+
runs-on: ubuntu-22.04
60+
needs: [build]
61+
services:
62+
postgres:
63+
image: postgres:13.0
64+
env:
65+
POSTGRES_USER: odoo
66+
POSTGRES_PASSWORD: odoo
67+
POSTGRES_DB: odoo
68+
ports:
69+
- 5432:5432
70+
steps:
71+
- name: Set up Docker
72+
uses: docker/setup-docker-action@v4
73+
- name: Prepare env files
74+
run: |
75+
BASE_IMAGE="ghcr.io/${{ github.repository_owner }}/curq-ci:${{ github.base_ref }}"
76+
MODULES=$(docker run --rm $BASE_REF_IMAGE -c "manifestoo -d /odoo/custom list | grep _install | paste -sd,")
77+
cat > .env.base <<EOF
78+
DB_HOST=postgres
79+
DB_PORT=5432
80+
DB_USER=odoo
81+
DB_PASSWORD=odoo
82+
MODULES=$MODULES
83+
WORKERS=0
84+
MODE=InstallOnly
85+
DOCKER=true
86+
DB_NAME=main
87+
DB_FILTER=^main$
88+
EOF
89+
- name: Initialize ${{ github.base_ref }}
90+
run: |
91+
docker run ghcr.io/${{ github.repository_owner }}/curq-ci:${{ github.base_ref }} \
92+
--entrypoint /usr/local/bin/entrypoint.sh \
93+
--env-file .env.base
94+
- name: Test Update
95+
run: |
96+
docker run ghcr.io/${{ github.repository_owner }}/curq-ci:pr-${{ github.event.pull_request.number }} \
97+
--entrypoint /usr/local/bin/entrypoint.sh \
98+
--env-file .env.base \
99+
-e MODE=UpdateOnly
100+

Dockerfile

+2-2
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:19df7a6678c475d91eefbb5c0f8d0c3a1db6197d 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
@@ -79,7 +79,7 @@ RUN pip install --no-cache-dir -r /odoo/src/odoo/requirements.txt -r /odoo/custo
7979
RUN pip install -e /odoo/src/odoo
8080
RUN rm -rf /odoo/wheels
8181

82-
FROM base as ci
82+
FROM base AS ci
8383
RUN pip install --no-cache-dir coverage manifestoo checklog-odoo odoo-test-helper
8484
RUN apt-get update && apt-get install expect -y
8585
ENTRYPOINT [ "/bin/bash" ]

0 commit comments

Comments
 (0)