|
| 1 | +name: tests (PyPI) |
| 2 | +# fetching the OpenG2P dependencies from OpenSPP PyPI, locked to the version of the OpenSPP 17.0.1.2 (batanes) release |
| 3 | + |
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - "17.0" |
| 8 | + - "17.0-ocabot-*" |
| 9 | + - "farmer-registry" |
| 10 | +env: |
| 11 | + OCA_GIT_USER_NAME: openspp |
| 12 | + OCA_GIT_USER_EMAIL: [email protected] |
| 13 | +jobs: |
| 14 | + unreleased-deps: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + name: Detect unreleased dependencies |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + - run: | |
| 20 | + for reqfile in requirements.txt test-requirements.txt ; do |
| 21 | + if [ -f ${reqfile} ] ; then |
| 22 | + result=0 |
| 23 | + # reject non-comment lines that contain a / (i.e. URLs, relative paths) |
| 24 | + grep "^[^#].*/" ${reqfile} || result=$? |
| 25 | + if [ $result -eq 0 ] ; then |
| 26 | + echo "Unreleased dependencies found in ${reqfile}." |
| 27 | + # exit 1 |
| 28 | + fi |
| 29 | + fi |
| 30 | + done |
| 31 | + test: |
| 32 | + runs-on: ubuntu-22.04 |
| 33 | + container: ${{ matrix.container }} |
| 34 | + name: ${{ matrix.name }} |
| 35 | + strategy: |
| 36 | + fail-fast: false |
| 37 | + matrix: |
| 38 | + include: |
| 39 | + - container: ghcr.io/openspp/oca-ci/py3.10-odoo17.0:jammy |
| 40 | + name: test with Odoo 17/Ubuntu 22.04 |
| 41 | + makepot: "true" |
| 42 | + sonar: "true" |
| 43 | + services: |
| 44 | + postgres: |
| 45 | + image: postgis/postgis:15-3.4 |
| 46 | + env: |
| 47 | + POSTGRES_USER: odoo |
| 48 | + POSTGRES_PASSWORD: odoo |
| 49 | + POSTGRES_DB: odoo |
| 50 | + ports: |
| 51 | + - 5432:5432 |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v4 |
| 54 | +# with: |
| 55 | +# persist-credentials: false |
| 56 | + - name: Disable demo data |
| 57 | + run: | |
| 58 | + echo "without_demo = all" >> /etc/odoo.cfg |
| 59 | + cat /etc/odoo.cfg |
| 60 | + - name: Remove g2p_connect_demo from openspp-modules as it is not compatible with all OpenSPP variants |
| 61 | + run: | |
| 62 | + rm -rf g2p_connect_demo |
| 63 | + - name: Create tests-requirements file |
| 64 | + run: | |
| 65 | + touch tmp-requirements.txt |
| 66 | + echo "-r openg2p-requirements.txt" >> tmp-requirements.txt |
| 67 | + echo "odoo-addon-muk-web-theme==17.0.1.2.1.3" >> tmp-requirements.txt |
| 68 | + cat test-requirements.txt >> tmp-requirements.txt |
| 69 | + cp tmp-requirements.txt test-requirements.txt |
| 70 | + - name: Install addons and dependencies |
| 71 | + env: |
| 72 | + SKIP_EXT_DEB_DEPENDENCIES: "true" |
| 73 | + EXCLUDE_REGEX: "odoo-addon-g2p.*|odoo-addon-muk.*" |
| 74 | + run: oca_install_addons |
| 75 | + - name: Check licenses |
| 76 | + run: manifestoo -d . check-licenses |
| 77 | + continue-on-error: true |
| 78 | + - name: Check development status |
| 79 | + run: manifestoo -d . check-dev-status --default-dev-status=Beta |
| 80 | + continue-on-error: true |
| 81 | + - name: Initialize test db |
| 82 | + run: oca_init_test_database |
| 83 | + - name: Remove test files from pip-installed addons |
| 84 | + run: | |
| 85 | + rm -rf /opt/odoo-venv/lib/python3.10/site-packages/odoo/addons/g2p_programs/tests |
| 86 | + rm -rf /opt/odoo-venv/lib/python3.10/site-packages/odoo/addons/g2p_registry_individual/tests |
| 87 | + - name: Run tests |
| 88 | + env: |
| 89 | + EXCLUDE: "g2p_bank,g2p_entitlement_differential,g2p_entitlement_in_kind,g2p_entitlement_voucher,g2p_payment_cash,g2p_payment_files,g2p_payment_g2p_connect,g2p_payment_interop_layer,g2p_payment_phee,g2p_payment_simple_mpesa,g2p_program_approval,g2p_program_assessment,g2p_program_autoenrol,g2p_program_cycleless,g2p_program_documents,g2p_program_registrant_info,g2p_program_reimbursement,g2p_programs,g2p_proxy_means_test,g2p_registry_addl_info,g2p_registry_base,g2p_registry_group,g2p_registry_individual,g2p_registry_membership,muk_product,muk_web_appsbar,muk_web_chatter,muk_web_colors,muk_web_dialog,muk_web_theme,g2p_openid_vci_rest_api,g2p_openid_vci,g2p_registry_encryption,g2p_encryption,g2p_encryption_keymanager" |
| 90 | + run: oca_run_tests |
| 91 | + - uses: codecov/codecov-action@v4 |
| 92 | + with: |
| 93 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 94 | + - name: Update .pot files |
| 95 | + run: oca_export_and_push_pot https://x-access-token:${{ secrets.GIT_PUSH_TOKEN }}@github.com/${{ github.repository }} |
| 96 | + if: ${{ matrix.makepot == 'true' && github.event_name == 'push' && github.repository_owner == 'openspp' }} |
0 commit comments