File tree Expand file tree Collapse file tree 11 files changed +280
-51
lines changed Expand file tree Collapse file tree 11 files changed +280
-51
lines changed Original file line number Diff line number Diff line change 11name : Run Tests
22
33on :
4- push :
4+ pull_request :
55 branches :
66 - main
7- pull_request :
7+ paths-ignore :
8+ - ' /docs/**'
9+ push :
810 branches :
911 - main
10-
1112 workflow_dispatch :
1213
1314jobs :
3334 include :
3435 - PGVERSION : 14
3536 TEST : tablespaces
36- - PGVERSION : 14
37- TEST : linting
3837 steps :
3938 - name : Checkout repository
4039 uses : actions/checkout@v3
@@ -43,38 +42,13 @@ jobs:
4342 run : |
4443 echo "PGVERSION=${{ matrix.PGVERSION }}" >> $GITHUB_ENV
4544 echo "TEST=${{ matrix.TEST }}" >> $GITHUB_ENV
46- echo "LINTING=${{ matrix.LINTING }}" >> $GITHUB_ENV
4745 echo "TRAVIS_BUILD_DIR=$(pwd)" >> $GITHUB_ENV
4846
49- - name : Clone and install linting tools
50- if : ${{ env.TEST == 'linting' }}
51- run : |
52- sudo apt-get install python3-pip
53- pip3 install --user black
54- black --version
55- gcc --version
56- git clone -b v0.8.19 --depth 1 https://github.com/citusdata/tools.git ../tools
57- sudo make -C ../tools install
58- install_uncrustify
59- rm -rf uncrustify*
60-
61- - name : Check code formatting and banned function
62- if : ${{ env.TEST == 'linting' }}
63- run : |
64- make lint
65-
66- - name : Build documentation
67- if : ${{ env.TEST == 'linting' }}
68- run : |
69- make build-docs
70-
7147 - name : Build Docker Test Image
72- if : ${{ env.TEST != 'linting' }}
7348 run : |
7449 make build-test-image
7550
7651 - name : Run Test
77- if : ${{ env.TEST != 'linting' }}
7852 timeout-minutes : 15
7953 run : |
8054 make ci-test
Original file line number Diff line number Diff line change 1+ name : Build docs
2+
3+ env :
4+ context : /docs
5+ sphinx_image : hapostgres/sphinx-citus:latest
6+
7+ on :
8+ pull_request :
9+ branches :
10+ - main
11+ paths-ignore :
12+ - ' ${{ env.context }}/tikz/**'
13+ paths :
14+ - " ${{ env.context }}/**"
15+ push :
16+ branches :
17+ - main
18+ workflow_dispatch :
19+
20+ jobs :
21+ docs :
22+ name : Build sphinx html
23+ runs-on : ubuntu-latest
24+ strategy :
25+ fail-fast : true
26+ steps :
27+ - name : Checkout repository
28+ uses : actions/checkout@v4
29+
30+ - name : Set up Docker Buildx
31+ uses : docker/setup-buildx-action@v3
32+
33+ - name : Build hapostgres/sphinx-citus docker image
34+ uses : docker/build-push-action@v5
35+ with :
36+ context : " .${{ env.context }}"
37+ load : true
38+ tags : ${{ env.sphinx_image }}
39+ cache-from : type=gha
40+ cache-to : type=gha,mode=max
41+
42+ - name : Build docs with sphinx
43+ run : " docker run --rm -v .${{ env.context }}:/docs ${{ env.sphinx_image }} make html"
Original file line number Diff line number Diff line change 1+ name : Build pictures
2+
3+ env :
4+ context : /docs/tikz
5+ tikz_image : hapostgres/latexmk-pdftocairo:latest
6+
7+ on :
8+ pull_request :
9+ branches :
10+ - main
11+ paths :
12+ - " ${{ env.context }}/**"
13+ push :
14+ branches :
15+ - main
16+ workflow_dispatch :
17+
18+ jobs :
19+ pictures :
20+ name : Building latexmk/pdftocairo pictures
21+ runs-on : ubuntu-latest
22+ strategy :
23+ fail-fast : true
24+ steps :
25+ - name : Checkout repository
26+ uses : actions/checkout@v4
27+
28+ - name : Set up Docker Buildx
29+ uses : docker/setup-buildx-action@v3
30+
31+ - name : Build hapostgres/latexmk-pdftocairo docker image
32+ uses : docker/build-push-action@v5
33+ with :
34+ context : " .${{ env.context }}"
35+ load : true
36+ tags : ${{ env.tikz_image }}
37+ cache-from : type=registry,ref=user/app:latest
38+ cache-to : type=inline
39+
40+ - name : Build pdf/png/svg files
41+ run : " docker run --rm -v .${{ env.context }}:/tikz ${{ env.tikz_image }} make all"
Original file line number Diff line number Diff line change 1+ name : Code Linting/Checking
2+
3+ on :
4+ pull_request :
5+ branches :
6+ - main
7+ push :
8+ branches :
9+ - main
10+ workflow_dispatch :
11+
12+ jobs :
13+ linting :
14+ name : Run Linting and friends
15+ runs-on : ubuntu-latest
16+ strategy :
17+ fail-fast : true
18+ steps :
19+ - name : Checkout repository
20+ uses : actions/checkout@v3
21+
22+ - name : Set environment variables
23+ run : |
24+ echo "TRAVIS_BUILD_DIR=$(pwd)" >> $GITHUB_ENV
25+
26+ - name : Clone and install linting tools
27+ run : |
28+ sudo apt-get install python3-pip
29+ pip3 install --user black
30+ black --version
31+ gcc --version
32+ git clone -b v0.8.19 --depth 1 https://github.com/citusdata/tools.git ../tools
33+ sudo make -C ../tools install
34+ install_uncrustify
35+ rm -rf uncrustify*
36+
37+ - name : Check code formatting and banned function
38+ run : |
39+ make lint
Original file line number Diff line number Diff line change @@ -52,3 +52,6 @@ docs/tikz/*.png
5252# Exclude our demo/test tmux directory
5353tmux /
5454valgrind /
55+
56+ # Exclude docker ID files
57+ docker.id *
Original file line number Diff line number Diff line change 1+ ARG DEBIAN_TAG="bullseye-slim"
2+
3+ FROM debian:${DEBIAN_TAG} as python-slim
4+
5+ ARG DEBIAN_TAG
6+
7+ LABEL org.opencontainers.image.authors = "Data Bene <https://data-bene.io/>"
8+ LABEL org.opencontainers.image.source = "https://github.com/hapostgres/pg_auto_failover/tree/main/docs/Dockerfile"
9+ LABEL org.opencontainers.image.version = "${DEBIAN_TAG}"
10+ LABEL org.opencontainers.image.licenses = "PostgreSQL License"
11+ LABEL org.opencontainers.image.description = "A better python3 slim with pip"
12+
13+ RUN apt-get update \
14+ && apt-get install --no-install-recommends --yes \
15+ make \
16+ python3-minimal \
17+ python3-pip \
18+ && apt-get autoremove \
19+ && apt-get clean \
20+ && rm -rf /var/lib/apt/lists/*
21+
22+ FROM python-slim
23+
24+ WORKDIR /docs
25+ COPY requirements.txt .
26+ RUN python3 -m pip install --upgrade --no-cache-dir pip install -r requirements.txt
27+
28+ CMD ["python3" , "--help" ]
Original file line number Diff line number Diff line change 1- # Minimal makefile for Sphinx documentation
2- #
1+ .DEFAULT_GOAL := all
32
43# You can set these variables from the command line.
54SPHINXOPTS =
@@ -8,13 +7,51 @@ SPHINXPROJ = pg_auto_failover
87SOURCEDIR = .
98BUILDDIR = _build
109
11- # Put it first so that "make" without argument is like "make help".
10+ DEPS = $(wildcard * .rst) $(wildcard ref/* .rst)
11+
12+ # If USE_DOCKER variable is defined, we're working with docker and use the tools
13+ # from image/container instead of current OS.
14+ ifdef USE_DOCKER
15+ SPHINX_IMAGE = hapostgres/sphinx-citus:latest
16+ endif
17+
18+ .PHONY : all
19+ all : tikz html
20+
21+ .PHONY : clean
22+ clean :
23+ rm -f docker.id
24+ rm -rf _build _html
25+ $(MAKE ) -C tikz $@
26+
27+ .PHONY : maintainer-clean
28+ maintainer-clean : clean
29+ $(MAKE ) -C tikz $@
30+ ifdef USE_DOCKER
31+ docker image rm $(SPHINX_IMAGE)
32+ endif
33+
34+ ifdef USE_DOCKER
35+ SPHINXBUILD = docker run --rm -u $(shell id -u) :$(shell id -g) -v $(SOURCEDIR ) /:/docs $(SPHINX_IMAGE ) sphinx-build
36+ docker.id : Dockerfile requirements.txt
37+ docker build --iidfile docker.id --file $< -t $(SPHINX_IMAGE ) .
38+ else
39+ docker.id : ;
40+ endif
41+
42+ .PHONY : help
1243help :
1344 @$(SPHINXBUILD ) -M help " $( SOURCEDIR) " " $( BUILDDIR) " $(SPHINXOPTS ) $(O )
1445
15- .PHONY : help Makefile
46+ .PHONY : html
47+ html : $(BUILDDIR ) /html
48+
49+ .PHONY : tikz
50+ tikz :
51+ $(MAKE ) -C tikz all
1652
1753# Catch-all target: route all unknown targets to Sphinx using the new
1854# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19- % : Makefile
20- @$(SPHINXBUILD ) -M $@ " $( SOURCEDIR) " " $( BUILDDIR) " $(SPHINXOPTS ) $(O )
55+ $(BUILDDIR ) /html : $(DEPS ) docker.id
56+ echo $?
57+ $(SPHINXBUILD ) -M html " $( SOURCEDIR) " " $( BUILDDIR) " $(SPHINXOPTS ) $(O )
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ def __init__(self, **options):
9999# The theme to use for HTML and HTML Help pages. See the documentation for
100100# a list of builtin themes.
101101#
102- html_theme = "sphinx_rtd_theme "
102+ html_theme = "sphinx_rtd_theme_citus "
103103
104104# Theme options are theme-specific and customize the look and feel of a theme
105105# further. For a list of options available for each theme, see the
Original file line number Diff line number Diff line change 1- Sphinx == 4.0.2
1+ Sphinx == 5.3.0
22sphinx_rtd_theme_citus == 0.5.25
33docutils == 0.16
4- readthedocs-sphinx-search == 0.1.0
4+ readthedocs-sphinx-search == 0.3.1
Original file line number Diff line number Diff line change 1+ ARG DEBIAN_TAG="bullseye-slim"
2+
3+ FROM debian:${DEBIAN_TAG} as luatex
4+
5+ ARG DEBIAN_TAG
6+
7+ LABEL org.opencontainers.image.authors = "Data Bene <https://data-bene.io/>"
8+ LABEL org.opencontainers.image.source = "https://github.com/hapostgres/pg_auto_failover/tree/main/docs/tikz/Dockerfile"
9+ LABEL org.opencontainers.image.version = "${DEBIAN_TAG}"
10+ LABEL org.opencontainers.image.licenses = "PostgreSQL License"
11+ LABEL org.opencontainers.image.description = "Docs builder with latexmk and pdftocairo"
12+
13+ RUN apt-get update \
14+ && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
15+ make \
16+ latexmk \
17+ poppler-utils \
18+ texlive \
19+ texlive-luatex \
20+ texlive-latex-extra \
21+ texlive-fonts-extra \
22+ && apt-get autoremove \
23+ && apt-get clean \
24+ && rm -rf /var/lib/apt/lists/*
25+
26+ FROM luatex
27+
28+ WORKDIR /tikz
29+
30+ ENV TERM=dumb
31+ ENV TEXMFHOME = /.cache/
32+ ENV TEXMFVAR = /.cache/texmf-var/
33+ ENV TEXMFCONFIG = $TEXMFSYSCONFIG
34+
35+ RUN luaotfload-tool --update
You can’t perform that action at this time.
0 commit comments