imp: project #2
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: isOdoo Cookiecutter Template | |
| on: | |
| pull_request: | |
| branches: [cookiecutter] | |
| push: | |
| branches: [cookiecutter] | |
| schedule: | |
| - cron: '0 8 * * 0' | |
| workflow_dispatch: | |
| jobs: | |
| pre-commit: | |
| runs-on: ubuntu-24.04 | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| PYTHONDONTWRITEBYTECODE: 1 | |
| PYTHONUNBUFFERED: 1 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: "Set up Python" | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Restore pre-commit cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ hashFiles('.pre-commit-config.yaml') }} | |
| restore-keys: | | |
| pre-commit-${{ runner.os }}-${{ hashFiles('uv.lock') }}-${{ hashFiles('.pre-commit-config.yaml') }} | |
| pre-commit-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
| pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} | |
| pre-commit-${{ runner.os }} | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| - uses: pre-commit/action@v3.0.1 | |
| pytest: | |
| strategy: | |
| matrix: | |
| odoo_version: ["19.0"] | |
| fail-fast: false | |
| runs-on: ubuntu-24.04 | |
| needs: pre-commit | |
| env: | |
| DEBIAN_FRONTEND: noninteractive | |
| PYTHONDONTWRITEBYTECODE: 1 | |
| PYTHONUNBUFFERED: 1 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: "Set up Python" | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v7 | |
| - name: Restore uv cache | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.cache/uv | |
| key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
| restore-keys: | | |
| uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
| uv-${{ runner.os }} | |
| - name: Install the project | |
| run: uv sync --locked --all-extras --dev | |
| - name: Run pytest | |
| run: uv run pytest --odoo-version ${{ matrix.odoo_version }} --client-type docker -v | |
| - name: Minimize uv cache | |
| run: uv cache prune --ci |