Skip to content

Commit

Permalink
ci/ga/docs: Use default python-architecture for each platform to buil…
Browse files Browse the repository at this point in the history
…d docs

In practise it means x64 for linux and windows and arm64 for macos.

Restrict python3.7 macos jobs to macos-13.
x64 builds are broken on macos-14 images[0],
but python3.7 does not provide arm64 image[1]

[0] actions/setup-python#855
[1] actions/setup-python#856

Signed-off-by: Jan Vesely <[email protected]>
  • Loading branch information
jvesely committed Apr 26, 2024
1 parent 63cefb1 commit 84f0a7a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/pnl-ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ concurrency:

jobs:
docs-build:
runs-on: ${{ matrix.os }}
# Python 3.7 x64 on macos-14 (arm64) images is broken [0]
# and arm64 version is not available [1].
# Restrict python 3.7 macos runs to macos-13
# [0] https://github.com/actions/setup-python/issues/855
# [1] https://github.com/actions/setup-python/issues/856
runs-on: ${{ (matrix.os == 'macos-latest' && matrix.python-version == '3.7') && 'macos-13' || matrix.os }}
strategy:
fail-fast: false
# Matrix setup is a hacky way to include 'base' build in pull requests
# The entire matrix is set up and 'base' builds are pruned based
# on event name and final configuration (ubuntu, python3.11).
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
python-architecture: ['x64']
os: [ubuntu-latest, macos-latest, windows-latest]
event:
- ${{ github.event_name }}
Expand Down Expand Up @@ -81,7 +85,6 @@ jobs:
# Block python3.7.17 on macos. see:
# https://github.com/actions/setup-python/issues/682
python-version: ${{ (matrix.os == 'macos-latest' && matrix.python-version == '3.7') && '3.7.16' || matrix.python-version }}
architecture: ${{ matrix.python-architecture }}

- name: Get pip cache location
shell: bash
Expand All @@ -95,8 +98,8 @@ jobs:
uses: actions/cache@v4
with:
path: ${{ steps.pip_cache.outputs.pip_cache_dir }}/wheels
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ matrix.python-architecture }}-pip-wheels-${{ hashFiles('requirements.txt', 'doc_requirements.txt') }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ matrix.python-architecture }}-pip-wheels-${{ hashFiles('requirements.txt', 'doc_requirements.txt') }}
key: ${{ runner.os }}-python-${{ matrix.python-version }}-pip-wheels-${{ hashFiles('requirements.txt', 'doc_requirements.txt') }}-${{ github.sha }}
restore-keys: ${{ runner.os }}-python-${{ matrix.python-version }}-pip-wheels-${{ hashFiles('requirements.txt', 'doc_requirements.txt') }}

# We need to install all PNL deps since docs config imports psyneulink module
- name: Install local, editable PNL package
Expand Down Expand Up @@ -126,7 +129,7 @@ jobs:
- name: Upload Documentation
uses: actions/upload-artifact@v4
with:
name: Documentation-${{matrix.pnl-version}}-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}
name: Documentation-${{matrix.pnl-version}}-${{ matrix.os }}-${{ matrix.python-version }}
retention-days: 1
path: docs/build/html

Expand Down Expand Up @@ -172,7 +175,7 @@ jobs:
- name: Download branch docs
uses: actions/download-artifact@v4
with:
name: Documentation-head-${{ matrix.os }}-${{ matrix.python-version }}-x64
name: Documentation-head-${{ matrix.os }}-${{ matrix.python-version }}
path: _built_docs/${{ github.ref }}
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/docs'

Expand All @@ -189,7 +192,7 @@ jobs:
- name: Download main docs
uses: actions/download-artifact@v4
with:
name: Documentation-head-${{ matrix.os }}-${{ matrix.python-version }}-x64
name: Documentation-head-${{ matrix.os }}-${{ matrix.python-version }}
# This overwrites files in current directory
if: startsWith(github.ref, 'refs/tags/') && contains(needs.*.outputs.on_master, 'master')

Expand Down

0 comments on commit 84f0a7a

Please sign in to comment.