Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX: speed up workflows with Docker images #298

Closed
wants to merge 24 commits into from
Closed
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
53ca048
FIX: hash only `.py` files under the `src` directory
redeboer Mar 27, 2023
8a3bbf1
FIX: correctly hash `.jl` files
redeboer Mar 27, 2023
918bbcf
DX: run slow documentation job on PRs
redeboer Mar 27, 2023
edff447
DX: run fast doc jobs in Docker containers
redeboer Mar 27, 2023
959133c
FIX: set Docker container through `container.image`
redeboer Mar 27, 2023
82358ef
DX: speed up slow doc job with `compwa/polarimetry-documentation:v1` …
redeboer Mar 27, 2023
447613f
FIX: do not setup Python when using `container.image`
redeboer Mar 27, 2023
92814b5
FIX: remove `apt-get` install statement
redeboer Mar 27, 2023
d613511
MAINT: add `Dockerfile`s
redeboer Mar 27, 2023
26faf70
DX: add Docker VS Code extension
redeboer Mar 27, 2023
701e734
FIX: avoid Alpine in Docker containers
redeboer Mar 27, 2023
0403345
DX: automatically build Docker images
redeboer Mar 27, 2023
e600ed2
MAINT: push Docker container with SHA
redeboer Mar 27, 2023
a25a80a
TEMP: build Docker containers on push to `docker-images` branch
redeboer Mar 27, 2023
35a938d
DX: add name to Docker container build job
redeboer Mar 27, 2023
ff58f86
MAINT: fine-grain Docker image tag
redeboer Mar 27, 2023
fabf38c
DX: speed up workflow with Docker containers
redeboer Mar 27, 2023
0c02243
MAINT: install packages with `ComPWA/actions/pip-install`
redeboer Mar 27, 2023
dd22a9c
MAINT: update docker SHA
redeboer Mar 27, 2023
7e50624
FIX: install Python explicitly in Docker
redeboer Mar 27, 2023
58b7596
MAINT: run Docker with eforced Python version (7e50624)
redeboer Mar 27, 2023
031bc43
MAINT: move autopush-docker to ComPWA/polarimetry#299
redeboer Mar 27, 2023
71ee68f
FIX: do not install Python through `actions/setup-python`
redeboer Mar 27, 2023
d33ace1
MAINT: update Docker SHA
redeboer Mar 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 19 additions & 24 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
env:
JULIA_CI: "true"
PYTHONHASHSEED: "0"
PYTHON_VERSION: "3.8"
PYTHON_VERSION: "3.9"

on:
workflow_call:
Expand Down Expand Up @@ -32,15 +32,18 @@ jobs:
fast-pdf:
if: inputs.specific-pip-packages == ''
name: Build PDF (fast)
container:
image: ghcr.io/compwa/polarimetry-fast-pdf:sha-37b24e6
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: ComPWA/actions/pip-install@v1
with:
additional-packages: tox
extras: doc
python-version: ${{env.PYTHON_VERSION}}
- run: sudo apt install -y inkscape latexmk make texlive-fonts-extra texlive-xetex xindy
- run: tox -e pdf
- uses: actions/upload-artifact@v3
if: ${{ always() }}
Expand All @@ -63,66 +66,58 @@ jobs:

documentation:
name: Run notebooks and build documentation
if: github.event_name != 'pull_request'
runs-on: ubuntu-22.04
container:
image: ghcr.io/compwa/polarimetry-documentation:sha-37b24e6
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
steps:
- uses: actions/checkout@v3
- uses: ComPWA/actions/pip-install@v1
with:
additional-packages: tox
extras: doc
python-version: ${{env.PYTHON_VERSION}}
specific-packages: ${{ inputs.specific-pip-packages }}
- run: sudo apt-get -y install cm-super dvipng inkscape latexmk texlive-fonts-extra texlive-latex-extra texlive-xetex xindy
- name: Fetch Julia cache
uses: actions/cache@v3
with:
key: |
julia-${{hashFiles('julia/Manifest.toml')}}-${{hashFiles('**.jl')}}
julia-${{hashFiles('julia/Manifest.toml')}}-${{hashFiles('./**.jl')}}
restore-keys: |
julia-${{hashFiles('julia/Manifest.toml')}}
julia
path: |
./julia-*/
~/.julia/
- name: Install Julia
- name: Initialize Julia environment
run: |
version=$(sed -n '3p' julia/Manifest.toml)
version=${version:17:-1}
major_version=${version:0:-2}
filename=julia-${version}-linux-x86_64.tar.gz
if [ ! -d julia-${version} ]; then
wget -q https://julialang-s3.julialang.org/bin/linux/x64/${major_version}/${filename}
tar xzf ${filename}
fi
sudo ln -s $(pwd)/julia-${version}/bin/julia /usr/local/bin/julia
julia --version
julia --project=./julia -e 'import Pkg; Pkg.instantiate()'
- name: Fetch SymPy cache
uses: actions/cache@v3
with:
key: |
sympy-${{hashFiles('.constraints/py3.*.txt', 'setup.cfg')}}-${{hashFiles('src/**')}}-${{hashFiles('docs/**.ipynb')}}
sympy-${{hashFiles('.constraints/py3.*.txt', 'setup.cfg')}}-${{hashFiles('src/**.py')}}-${{hashFiles('docs/**.ipynb')}}
restore-keys: |
sympy-${{hashFiles('.constraints/py3.*.txt', 'setup.cfg')}}-${{hashFiles('src/**')}}
sympy-${{hashFiles('.constraints/py3.*.txt', 'setup.cfg')}}-${{hashFiles('src/**.py')}}
sympy-${{hashFiles('.constraints/py3.*.txt', 'setup.cfg')}}
path: ~/.sympy-cache*/
- name: Fetch Jupyter cache
uses: actions/cache@v3
with:
key: |
jupyter-cache-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**')}}-${{hashFiles('docs/**')}}
jupyter-cache-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**.py')}}-${{hashFiles('docs/**')}}
restore-keys: |
jupyter-cache-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**')}}
jupyter-cache-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**.py')}}
path: |
./docs/_build/.jupyter_cache
- name: Fetch output files
uses: actions/cache@v3
with:
key: |
output-files-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**')}}-${{hashFiles('docs/**')}}
output-files-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**.py')}}-${{hashFiles('docs/**')}}
restore-keys: |
output-files-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**')}}
output-files-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**.py')}}
output-files
path: |
./docs/_images
Expand Down