[IMP] copier update

This commit is contained in:
Luc De Meyer committed 2026-11-08 22:00:23 +01:00
1 parent 8cd1100dd7
commit 3cff4fbe0d
10 files changed
+105 -174

No files matched your search

+49 -33
View File
@@ -20,11 +20,11 @@ jobs:
- uses: actions/checkout@v7
- run: |
for reqfile in requirements.txt test-requirements.txt ; do
if [ -f ${reqfile} ] ; then
if [ -f "${reqfile}" ] ; then
result=0
# reject non-comment lines that contain a / (i.e. URLs, relative paths)
# unless they have a "# SKIP TEST" comment
grep "^[^#].*/" ${reqfile} | grep -v "# SKIP TEST" || result=$?
grep "^[^#].*/" "${reqfile}" | grep -v "# SKIP TEST" || result=$?
if [ $result -eq 0 ] ; then
echo "Unreleased dependencies found in ${reqfile}."
exit 1
@@ -33,7 +33,11 @@ jobs:
done
test:
runs-on: ubuntu-latest
container: ${{ matrix.container }}
container:
image: ${{ matrix.container }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.PRIVATE_TOKEN }}
name: ${{ matrix.name }}
permissions:
pull-requests: write
@@ -42,14 +46,15 @@ jobs:
fail-fast: false
matrix:
include:
- container: ghcr.io/oca/oca-ci/py3.12-odoo20.0:latest
- container: ghcr.io/noviat-ci/odoo-ci:20.0-stable
name: test with Odoo Community
odoo_enterprise : 0
exclude_modules : ""
- container: ghcr.io/oca/oca-ci/py3.12-odoo20.0:latest
exclude_modules : "account_asset"
skip: "account_zbics_batch_payment,account_ebics_oe"
- container: ghcr.io/noviat-ci/odoo-ci:20.0-stable
name: test with Odoo Enterprise
odoo_enterprise : 1
exclude_modules : ""
exclude_modules : "account_asset"
makepot: "true"
services:
postgres:
@@ -67,42 +72,43 @@ jobs:
- uses: actions/checkout@v7
with:
persist-credentials: false
- name: Upgrade pip in container
run: python -m pip install --upgrade pip
- name: Install Odoo upgrade util
run: python -m pip install git+https://github.com/odoo/upgrade-util@master
- name: Add Noviat CI Tools to PATH
run: |
git clone https://${{ secrets.PRIVATE_TOKEN }}@github.com/Noviat-CI/noviat-ci-tools.git /opt/noviat-ci-tools
echo "/opt/noviat-ci-tools" >> $GITHUB_PATH
- name: Clone Odoo Enterprise
if: ${{ matrix.odoo_enterprise == 1 }}
run : |
git clone https://${{ secrets.PRIVATE_TOKEN }}@github.com/odoo/enterprise.git --depth 1 -b 20.0 /opt/enterprise
- name: Clone Noviat Dependencies
- name: Configure git authentication
env:
PRIVATE_TOKEN: ${{ secrets.PRIVATE_TOKEN }}
TOKEN: ${{ secrets.PRIVATE_TOKEN }}
run: |
git config --global http.https://github.com/.extraheader "AUTHORIZATION: basic $(printf 'x-access-token:%s' "$TOKEN" | base64 -w0)"
- name: Show the CI image age
run: |
age=$(( ( $(date -u +%s) - $(date -u -d "$NOVIAT_CI_IMAGE_BUILD_DATE" +%s) ) / 86400 ))
echo "Image $NOVIAT_CI_ODOO_VERSION built $NOVIAT_CI_IMAGE_BUILD_DATE ($age days old)" | tee -a "$GITHUB_STEP_SUMMARY"
- name: Clone Noviat Dependencies
run: clone_oca_dependencies_by_noviat
- name: Create addons path
run: |
mkdir -p ${{ env.INSTALL_ADDONS_DIR }}/setup
find $(realpath $ADDONS_DIR) $(realpath ${{ env.ADDITIONAL_ADDONS_DIR }}) -name __manifest__.py -exec sh -c 'ln -s "$(dirname "$0")" "${{ env.INSTALL_ADDONS_DIR }}"' {} \;
find $(realpath $ADDONS_DIR) $(realpath ${{ env.ADDITIONAL_ADDONS_DIR }}) -iwholename '*/setup/*/setup.py' -exec sh -c 'ln -s "$(dirname "$0")" "${{ env.INSTALL_ADDONS_DIR }}/setup"' {} \;
if [ -n ${{ matrix.exclude}} ]
mkdir -p "$INSTALL_ADDONS_DIR/setup"
find "$(realpath "$ADDONS_DIR")" "$(realpath "$ADDITIONAL_ADDONS_DIR")" -name __manifest__.py -exec sh -c 'ln -s "$(dirname "$0")" "$1"' {} "$INSTALL_ADDONS_DIR" \;
find "$(realpath "$ADDONS_DIR")" "$(realpath "$ADDITIONAL_ADDONS_DIR")" -iwholename '*/setup/*/setup.py' -exec sh -c 'ln -s "$(dirname "$0")" "$1/setup"' {} "$INSTALL_ADDONS_DIR" \;
# EXCLUDE (from matrix.exclude) only exists with rebel module groups
if [ -n "${EXCLUDE:-}" ]
then
remove_excluded_modules ${{ env.INSTALL_ADDONS_DIR }} ${{ matrix.exclude }}
remove_excluded_modules "$INSTALL_ADDONS_DIR" "$EXCLUDE"
fi
- name: Skip addons
if: ${{ matrix.skip }}
env:
SKIPPED: ${{ matrix.skip }}
run: |
remove_excluded_modules "$INSTALL_ADDONS_DIR" "$SKIPPED"
echo "EXCLUDE=${EXCLUDE:+$EXCLUDE,}$SKIPPED" >> "$GITHUB_ENV"
echo "Not installed nor tested with Odoo Community: $SKIPPED" | tee -a "$GITHUB_STEP_SUMMARY"
- name: Update addons path with enterprise
if: ${{ matrix.odoo_enterprise == 1 }}
run: |
echo "ADDONS_PATH=/opt/odoo/addons,/opt/enterprise,${{ env.INSTALL_ADDONS_DIR }}" >> $GITHUB_ENV
echo "ADDONS_PATH=/opt/odoo/addons,/opt/enterprise,${{ env.INSTALL_ADDONS_DIR }}" >> "$GITHUB_ENV"
- name: Update addons path without enterprise
if: ${{ matrix.odoo_enterprise == 0 }}
run: |
echo "ADDONS_PATH=/opt/odoo/addons,${{ env.INSTALL_ADDONS_DIR }}" >> $GITHUB_ENV
- name: Inject GitHub token for Noviat orgs in test-requirements.txt
run: |
sed -i -E "s#https://github.com/(Noviat-(Projects|Generic|ARP|Internal))#https://${{ secrets.PRIVATE_TOKEN }}@github.com/\1#g" test-requirements.txt
echo "ADDONS_PATH=/opt/odoo/addons,${{ env.INSTALL_ADDONS_DIR }}" >> "$GITHUB_ENV"
- name: Install addons and dependencies
run: |
(ADDONS_PATH=${ADDONS_PATH} ADDONS_DIR=${INSTALL_ADDONS_DIR} oca_install_addons)
@@ -114,10 +120,19 @@ jobs:
- name: Run tests
run: oca_run_tests
- name: Generate coverage files
id: coverage
run: |
# oca_run_tests exits early without coverage data when there is no
# addon to test (e.g. a freshly scaffolded version branch).
if [ -z "$(oca_list_addons_to_test)" ]; then
echo "No addon to test, skipping coverage report."
exit 0
fi
coverage report -m
coverage xml -o coverage.xml
echo "report=true" >> "$GITHUB_OUTPUT"
- name: Code Coverage Summary Report
if: steps.coverage.outputs.report == 'true'
uses: irongut/CodeCoverageSummary@v1.3.0
with:
filename: 'coverage.xml'
@@ -126,7 +141,8 @@ jobs:
output: 'both'
hide_complexity: true
- name: Write to Job Summary
run: cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY
if: steps.coverage.outputs.report == 'true'
run: cat code-coverage-results.md >> "$GITHUB_STEP_SUMMARY"
- name: Update .pot files
run: noviat_export_and_push_pot https://x-access-token:${{ secrets.PRIVATE_TOKEN }}@github.com/${{ github.repository }}
run: noviat_export_and_push_pot https://github.com/${{ github.repository }}
if: ${{ matrix.makepot == 'true' && github.event_name == 'push' }}