Skip to content

16.0 staging test po export #246

16.0 staging test po export

16.0 staging test po export #246

Workflow file for this run

name: tests
on:
pull_request:
branches:
- "16.0*"
push:
branches:
- "16.0"
- "16.0-ocabot-*"
jobs:
unreleased-deps:
runs-on: ubuntu-latest
name: Detect unreleased dependencies
steps:
- uses: actions/checkout@v2
- run: |
for reqfile in requirements.txt test-requirements.txt ; do
if [ -f ${reqfile} ] ; then
result=0
# reject non-comment lines that contain a / (i.e. URLs, relative paths)
grep "^[^#].*/" ${reqfile} || result=$?
if [ $result -eq 0 ] ; then
echo "Unreleased dependencies found in ${reqfile}."
exit 1
fi
fi
done
test:
runs-on: ubuntu-22.04
container: ${{ matrix.container }}
name: ${{ matrix.name }}
strategy:
fail-fast: false
matrix:
include:
- container: ghcr.io/oca/oca-ci/py3.10-odoo16.0:latest
name: test with Odoo
- container: ghcr.io/oca/oca-ci/py3.10-ocb16.0:latest
makepo: "true"
name: test with OCB
services:
postgres:
image: postgres:12.0
env:
POSTGRES_USER: odoo
POSTGRES_PASSWORD: odoo
POSTGRES_DB: odoo
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Install addons and dependencies
run: |
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "$GITHUB_ACTOR"
pip install git-aggregator
gitaggregate -c repos.yml
pip install -r requirements.txt
find . -maxdepth 3 -mindepth 3 -name __manifest__.py -exec sh -c "ln -rs \$(dirname '{}') $ADDONS_PATH/" \;
echo "addons_path=${ADDONS_PATH},${ADDONS_DIR}" >> ${ODOO_RC}
- name: Check licenses
run: manifestoo -d . check-licenses
continue-on-error: true
- name: Check development status
run: manifestoo -d . check-dev-status --default-dev-status=Beta
continue-on-error: true
- name: Initialize test db
run: oca_init_test_database
- name: Run tests
run: oca_run_tests
- uses: codecov/codecov-action@v3
- name: Update .po files
run: |
git clone https://github.com/odoo/odoo -b 16.0 --depth 1
. /opt/odoo-venv/bin/activate
odoo/odoo-bin -c ${ODOO_RC} -d odoo -u all --load-language=he_IL --i18n-overwrite --stop-after-init
git config --global --add safe.directory $(pwd)
for path in $(find . -maxdepth 2 -mindepth 2 -name __manifest__.py); do
module=$(basename $(dirname $path))
echo $module
mkdir -p $module/i18n
odoo/odoo-bin -c ${ODOO_RC} -d odoo -l he_IL --i18n-export=$module/i18n/he_IL.po --modules=$module --logfile=/dev/null
git add $module/i18n/he_IL.po
done
if git commit -m '[UPD] translations' --dry-run; then
git fetch origin $GITHUB_HEAD_REF
git checkout $GITHUB_HEAD_REF
git commit -m '[UPD] translations'
git push origin $GITHUB_HEAD_REF
else
echo No changes, doing nothing
fi
if: ${{ matrix.makepo == 'true' }}