Skip to content

Commit 28962de

Browse files
committed
big bang
0 parents  commit 28962de

32 files changed

Lines changed: 2257 additions & 0 deletions

.github/workflows/docker_auto.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Automatic build on release and push to Docker Hub
2+
on:
3+
schedule:
4+
- cron: "0 0 * * SUN"
5+
push:
6+
branches:
7+
- master
8+
jobs:
9+
tests:
10+
uses: ./.github/workflows/test.yml
11+
publish-docker-image:
12+
runs-on: ubuntu-latest
13+
needs:
14+
- tests
15+
env:
16+
DOCKER_PLATFORMS: linux/amd64,linux/arm64
17+
DOCKER_IMAGE: ghtardo/docker-privoxy-https
18+
LASTEST_VERSION: "4.0.0"
19+
PRIVOXY_VERSION: "4.0.0"
20+
steps:
21+
- name: Set up QEMU
22+
uses: docker/setup-qemu-action@v3
23+
24+
- name: Set up Docker Buildx
25+
id: buildx
26+
uses: docker/setup-buildx-action@v3
27+
28+
- name: Login to Docker Hub
29+
id: login
30+
uses: docker/login-action@v3
31+
with:
32+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
33+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
34+
35+
- name: Cache Docker layers
36+
uses: actions/cache@v4
37+
with:
38+
path: /tmp/.buildx-cache
39+
key: ${{ runner.os }}-buildx-${{ github.sha }}
40+
restore-keys: |
41+
${{ runner.os }}-buildx-
42+
- name: Check out repo
43+
id: checkout
44+
uses: actions/checkout@v4
45+
46+
- name: Prepare env variables
47+
id: env
48+
run: |
49+
echo "BUILD_BRANCH=$(echo $GITHUB_REF | cut -d / -f 3 | cut -d. -f-2 | cut -d- -f1)" >> $GITHUB_ENV
50+
echo "BUILD_VER=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_ENV
51+
echo "BUILD_DATE=$(date +'%Y-%m-%d %H:%M:%S')" >> $GITHUB_ENV
52+
echo "GIT_SHA=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV
53+
echo "GIT_REF=$(git symbolic-ref -q --short HEAD || git describe --tags --exact-match)" >> $GITHUB_ENV
54+
- name: Build and push latest stable branch
55+
if: ${{ env.BUILD_VER == env.LASTEST_VERSION }}
56+
id: docker_build_latest
57+
uses: docker/build-push-action@v5
58+
with:
59+
context: .
60+
file: ./Dockerfile
61+
builder: ${{ steps.buildx.outputs.name }}
62+
platforms: ${{ env.DOCKER_PLATFORMS }}
63+
build-args: |
64+
PRIVOXY_VERSION=${{ env.PRIVOXY_VERSION }}
65+
push: true
66+
target: runtime
67+
labels: |
68+
org.opencontainers.image.authors=${{ github.repository_owner }}
69+
org.opencontainers.image.created=${{ env.BUILD_DATE }}
70+
org.opencontainers.image.description=Created from commit ${{ env.GIT_SHA }} and ref ${{ env.GIT_REF }}
71+
org.opencontainers.image.ref.name=${{ env.GIT_REF }}
72+
org.opencontainers.image.revision=${{ github.sha }}
73+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
74+
org.opencontainers.image.version=${{ env.BUILD_VER }}
75+
tags: |
76+
${{ env.DOCKER_IMAGE }}:latest
77+
${{ env.DOCKER_IMAGE }}:${{ env.BUILD_BRANCH }}
78+
${{ env.DOCKER_IMAGE }}:${{ env.BUILD_VER }}
79+
cache-from: type=local,src=/tmp/.buildx-cache
80+
cache-to: type=local,dest=/tmp/.buildx-cache-new
81+
82+
- name: Build and push everything else
83+
if: ${{ env.BUILD_VER != env.LASTEST_VERSION }}
84+
id: docker_build_regular
85+
uses: docker/build-push-action@v5
86+
with:
87+
context: .
88+
file: ./Dockerfile
89+
builder: ${{ steps.buildx.outputs.name }}
90+
platforms: ${{ env.DOCKER_PLATFORMS }}
91+
build-args: |
92+
PRIVOXY_VERSION=${{ env.PRIVOXY_VERSION }}
93+
push: true
94+
target: runtime
95+
labels: |
96+
org.opencontainers.image.authors=${{ github.repository_owner }}
97+
org.opencontainers.image.created=${{ env.BUILD_DATE }}
98+
org.opencontainers.image.description=Created from commit ${{ env.GIT_SHA }} and ref ${{ env.GIT_REF }}
99+
org.opencontainers.image.ref.name=${{ env.GIT_REF }}
100+
org.opencontainers.image.revision=${{ github.sha }}
101+
org.opencontainers.image.source=https://github.com/${{ github.repository }}
102+
org.opencontainers.image.version=${{ env.BUILD_VER }}
103+
tags: |
104+
${{ env.DOCKER_IMAGE }}:${{ env.BUILD_BRANCH }}
105+
${{ env.DOCKER_IMAGE }}:${{ env.BUILD_VER }}
106+
cache-from: type=local,src=/tmp/.buildx-cache
107+
cache-to: type=local,dest=/tmp/.buildx-cache-new
108+
109+
- name: Move cache
110+
run: |
111+
rm -rf /tmp/.buildx-cache
112+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

.github/workflows/test.yml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches: [4.0.0]
6+
workflow_call:
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
env:
12+
DEBIAN_FRONTEND: noninteractive
13+
POETRY_NO_INTERACTION: 1
14+
POETRY_NO_DEV: 1
15+
PYTHONDONTWRITEBYTECODE: 1
16+
PYTHONUNBUFFERED: 1
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-python@v4
21+
with:
22+
python-version: "3.13"
23+
- name: Install poetry
24+
uses: abatilo/actions-poetry@v3
25+
with:
26+
poetry-version: latest
27+
- uses: actions/cache@v4
28+
with:
29+
path: |
30+
~/.cache/pre-commit
31+
.venv
32+
.cache
33+
key: ${{ runner.os }}-{{ hashFiles('**/poetry.lock') }}-{{ hashFiles('**/.pre-commit-config.yaml') }}
34+
- name: Install dependencies
35+
run: |
36+
poetry config virtualenvs.in-project true
37+
poetry install
38+
- uses: pre-commit/action@v3.0.1
39+
40+
isodoo:
41+
strategy:
42+
matrix:
43+
odoo_version:
44+
- 6.0
45+
- 6.1
46+
- 7.0
47+
- 8.0
48+
- 9.0
49+
- 10.0
50+
- 11.0
51+
- 12.0
52+
- 13.0
53+
- 14.0
54+
- 15.0
55+
- 16.0
56+
- 17.0
57+
- 18.0
58+
- 19.0
59+
python-version: [3.13]
60+
fail-fast: false
61+
runs-on: ubuntu-latest
62+
needs: pre-commit
63+
env:
64+
DEBIAN_FRONTEND: noninteractive
65+
PYTHONDONTWRITEBYTECODE: 1
66+
PYTHONUNBUFFERED: 1
67+
68+
steps:
69+
- uses: actions/cache@v4
70+
with:
71+
path: |
72+
.venv
73+
.cache
74+
key: ${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
75+
76+
- name: Checkout
77+
uses: actions/checkout@v4
78+
with:
79+
fetch-depth: 0
80+
81+
- name: Switch to current branch
82+
run: git checkout ${{ env.BRANCH }}
83+
84+
- name: Set up Python
85+
uses: actions/setup-python@v5
86+
with:
87+
python-version: ${{ matrix.python-version }}
88+
89+
- name: Install poetry
90+
uses: abatilo/actions-poetry@v3
91+
with:
92+
poetry-version: latest
93+
94+
- name: Install dependencies
95+
run: |
96+
poetry config virtualenvs.in-project true
97+
poetry install
98+
99+
- name: Run pytest
100+
run: poetry run pytest --odoo-version ${{ matrix.odoo_version }} --no-cache -v

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
__pycache__/
2+
/.pytest_cache
3+
/.venv
4+
tests/data/addons/git
5+
!tests/data/addons/git/repos.yaml

.hadolint.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ignored:
2+
- DL3008
3+
- DL3013
4+
- DL3016
5+
trustedRegistries:
6+
- docker.io
7+
- "*.gcr.io"

.pre-commit-config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- repo: https://github.com/psf/black
9+
rev: 25.9.0
10+
hooks:
11+
- id: black
12+
- repo: https://github.com/hadolint/hadolint
13+
rev: v2.14.0
14+
hooks:
15+
- id: hadolint
16+
entry: poetry run hadolint

0 commit comments

Comments
 (0)