diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index 50407e3f..12fb8ce3 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -1,7 +1,7 @@ env: JULIA_CI: "true" PYTHONHASHSEED: "0" - PYTHON_VERSION: "3.9" + PYTHON_VERSION: "3.8" on: workflow_call: @@ -32,11 +32,6 @@ jobs: fast-pdf: if: inputs.specific-pip-packages == '' name: Build PDF (fast) - container: - image: ghcr.io/compwa/polarimetry-fast-pdf:sha-7e50624 - credentials: - username: ${{ github.actor }} - password: ${{ secrets.github_token }} runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 @@ -45,6 +40,7 @@ jobs: 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() }} @@ -67,12 +63,8 @@ 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-7e50624 - credentials: - username: ${{ github.actor }} - password: ${{ secrets.github_token }} steps: - uses: actions/checkout@v3 - uses: ComPWA/actions/pip-install@v1 @@ -81,45 +73,56 @@ jobs: 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: Initialize Julia environment + - name: Install Julia 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/**.py')}}-${{hashFiles('docs/**.ipynb')}} + sympy-${{hashFiles('.constraints/py3.*.txt', 'setup.cfg')}}-${{hashFiles('src/**')}}-${{hashFiles('docs/**.ipynb')}} restore-keys: | - sympy-${{hashFiles('.constraints/py3.*.txt', 'setup.cfg')}}-${{hashFiles('src/**.py')}} + sympy-${{hashFiles('.constraints/py3.*.txt', 'setup.cfg')}}-${{hashFiles('src/**')}} 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/**.py')}}-${{hashFiles('docs/**')}} + jupyter-cache-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**')}}-${{hashFiles('docs/**')}} restore-keys: | - jupyter-cache-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**.py')}} + jupyter-cache-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**')}} 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/**.py')}}-${{hashFiles('docs/**')}} + output-files-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**')}}-${{hashFiles('docs/**')}} restore-keys: | - output-files-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**.py')}} + output-files-${{hashFiles('.constraints/py3.*.txt', 'data/**', 'setup.cfg', 'src/**')}} output-files path: | ./docs/_images