Skip to content

Commit

Permalink
Run base Odoo tests in the pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
borna-ng committed Oct 15, 2024
1 parent 9c02a73 commit f1f020c
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ jobs:
packages: write
env:
GHCR_IMAGE_NAME: ghcr.io/jobrad-gmbh/odoo
outputs:
IMAGE_REV: ${{ steps.manifest.outputs.IMAGE_REV }}
steps:
- name: Create variables
shell: bash
Expand All @@ -131,6 +133,7 @@ jobs:
password: ${{ secrets.ARTIFACTORY_TOKEN }}

- name: Combine Docker images into a single multi-architecture image
id: manifest
shell: bash
run: |
IMAGE_AMD64="${GHCR_IMAGE_NAME}:${SHORT_REV}-amd64"
Expand All @@ -145,4 +148,15 @@ jobs:
docker manifest create "${IMAGE_REV}" "${IMAGE_AMD64}" "${IMAGE_ARM64}"
docker manifest push "${IMAGE_BRANCH}"
docker manifest push "${IMAGE_REV}"
echo "IMAGE_REV=${IMAGE_REV}" >> $GITHUB_OUTPUT
# TODO Push to artifactory
test:
runs-on: self-hosted
needs: combine-docker
steps:
- uses: actions/checkout@v3
- name: Run base Odoo tests
run: |
export ODOO_IMAGE=${{ needs.combine-docker.outputs.IMAGE_REV }}
docker compose -f tests/docker-compose.yml run --rm --remove-orphans odoo ./odoo-bin -d test --test-enable --stop
22 changes: 22 additions & 0 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
services:
postgres:
image: ghcr.io/jobrad-gmbh/postgis:13-3.4-alpine
environment:
POSTGRES_USER: &pguser odoo
POSTGRES_PASSWORD: &pgpassword odoo
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 1s
timeout: 5s
retries: 5

odoo:
image: ${ODOO_IMAGE:-ghcr.io/jobrad-gmbh/odoo:jobrad-15.0}
tty: True
depends_on:
postgres:
condition: service_healthy
environment:
PGHOST: postgres
PGUSER: *pguser
PGPASSWORD: *pgpassword

0 comments on commit f1f020c

Please sign in to comment.