update workflow #3
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: Odoo Tests | ||
on: | ||
push: | ||
branches: ["17.0*"] | ||
pull_request: | ||
branches: ["17.0*"] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
services: | ||
db: | ||
image: postgres:15 | ||
env: | ||
POSTGRES_USER: odoo | ||
POSTGRES_PASSWORD: odoo | ||
POSTGRES_DB: odoo | ||
ports: | ||
- 5432:5432 | ||
options: >- | ||
--health-cmd "pg_isready -U odoo -d odoo" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
odoo: | ||
image: odoo:17.0 | ||
depends_on: | ||
Check failure on line 30 in .github/workflows/test.yml GitHub Actions / Odoo TestsInvalid workflow file
|
||
db: | ||
condition: service_healthy | ||
env: | ||
HOST: db | ||
USER: odoo | ||
PASSWORD: odoo | ||
PGHOST: db | ||
PGPORT: 5432 | ||
PGUSER: odoo | ||
PGPASSWORD: odoo | ||
PGDATABASE: odoo | ||
options: >- | ||
--health-cmd "curl -f http://localhost:8069 || exit 1" | ||
--health-interval 10s | ||
--health-timeout 5s | ||
--health-retries 5 | ||
command: | | ||
odoo --db_host=db --db_user=odoo --db_password=odoo \ | ||
--database=odoo --init=restful --test-tags /restful --stop-after-init | ||
steps: | ||
- name: Check out the code | ||
uses: actions/checkout@v3 | ||
- name: Wait for Odoo to be ready | ||
run: | | ||
until curl -f http://localhost:8069; do | ||
echo "Waiting for Odoo..." | ||
sleep 5 | ||
done | ||
- name: Run Odoo tests | ||
run: | | ||
docker exec $(docker ps -q -f ancestor=odoo:17.0) \ | ||
odoo/odoo-bin --addons-path=addons,odoo/addons --db_host=db --db_user=odoo --db_password=odoo \ | ||
-d odoo --init=restful --test-tags /restful --stop-after-init |