-
Notifications
You must be signed in to change notification settings - Fork 0
149 lines (126 loc) · 4.42 KB
/
Copy pathisodoo.yml
File metadata and controls
149 lines (126 loc) · 4.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: isOdoo
on:
pull_request:
branches: [master]
push:
branches: [master]
jobs:
pre-commit:
runs-on: ubuntu-latest
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: ["6.0", "6.1", "7.0", "8.0", "9.0", "10.0", "11.0", "12.0", "13.0", "14.0", "15.0", "16.0", "17.0", "18.0", "19.0"]
fail-fast: false
runs-on: ubuntu-latest
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 }} --no-cache -v
- name: Minimize uv cache
run: uv cache prune --ci
build-and-push:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: pytest
permissions:
contents: read
packages: write
attestations: write
id-token: write
env:
DEBIAN_FRONTEND: noninteractive
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
LATEST_VERSION: "19.0"
strategy:
matrix:
version: ["6.0", "6.1", "7.0", "8.0", "9.0", "10.0", "11.0", "12.0", "13.0", "14.0", "15.0", "16.0", "17.0", "18.0", "19.0"]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=${{ matrix.version }}
type=raw,value=latest,enable=${{ matrix.version == env.LATEST_VERSION }}
labels: |
org.opencontainers.image.title=Odoo ${{ matrix.version }}
org.opencontainers.image.description=Odoo Community ${{ matrix.version }} - isOdoo Image
org.opencontainers.image.source=https://github.com/${{ github.repository }}
org.opencontainers.image.vendor=GrupoIsonor
odoo.version=${{ matrix.version }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & Push
id: build-and-push
uses: docker/build-push-action@v6
with:
context: .
file: ./${{ matrix.version }}.Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha,scope=odoo-${{ matrix.version }}
cache-to: type=gha,mode=max,scope=odoo-${{ matrix.version }}
provenance: mode=max
sbom: true
platforms: linux/amd64,linux/arm64