ci: add e2e workflow + fix preset compatibility for 12.0 and 18.0+ #7
This file contains hidden or 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: e2e | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| push: | |
| branches: | |
| - main | |
| schedule: | |
| - cron: "0 4 * * *" | |
| concurrency: | |
| group: ${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: Odoo ${{ matrix.odoo_version }} (Python ${{ matrix.python_version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - odoo_version: "18.0" | |
| python_version: "3.10" | |
| - odoo_version: "19.0" | |
| python_version: "3.10" | |
| steps: | |
| - name: Bootstrap | |
| run: | | |
| mkdir -p ~/code | |
| cat > ~/code/config.toml << 'EOF' | |
| versions = ["${{ matrix.odoo_version }}"] | |
| system_packages = ["postgresql"] | |
| [tools] | |
| uv = ["odoo-addons-path"] | |
| [repos] | |
| odoo = ["odoo"] | |
| EOF | |
| # workaround to be able to clone repos without ssh in CI: | |
| git config --global url."https://github.com/".insteadOf "git@github.com:" | |
| curl -fsSL https://raw.githubusercontent.com/trobz/local.py/main/bootstrap.sh | bash | |
| tlc --no-newcomer install-tools | |
| tlc --no-newcomer init | |
| echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
| # Cache the Odoo source for the day to avoid cloning on every run. | |
| # The key includes the date so the cache is invalidated daily, | |
| # ensuring we always test against a fresh Odoo clone each day. | |
| - name: Cache Odoo ${{ matrix.odoo_version }} | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/code/odoo/odoo/${{ matrix.odoo_version }} | |
| key: odoo-${{ matrix.odoo_version }}-${{ runner.os }}-${{ env.TODAY }} | |
| - name: Pull repos | |
| run: tlc --no-newcomer pull-repos | |
| - name: Check out odoo-venv | |
| uses: actions/checkout@v4 | |
| - name: Install odoo-venv | |
| run: uv tool install . | |
| - name: Create Odoo virtual environment | |
| run: | | |
| odoo-venv create --verbose ${{ matrix.odoo_version }} \ | |
| --odoo-dir ~/code/odoo/odoo/${{ matrix.odoo_version }} \ | |
| --venv-dir ~/code/venvs/${{ matrix.odoo_version }} \ | |
| --python-version ${{ matrix.python_version }} \ | |
| --create-launcher |