Skip to content

Commit

Permalink
CI : Blind test of sphinx on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
murraystevenson committed May 25, 2024
1 parent 1040b10 commit 2387a96
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 57 deletions.
95 changes: 48 additions & 47 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- main
- '*_maintenance'
- 'windowsDocs'
pull_request:
branches:
- '*'
Expand All @@ -28,48 +29,48 @@ jobs:
# and then use `include` to define their settings.

name: [
linux-gcc9,
linux-debug-gcc9,
linux-gcc11,
# linux-gcc9,
# linux-debug-gcc9,
# linux-gcc11,
windows,
]

include:

- name: linux-gcc9
os: ubuntu-20.04
buildType: RELEASE
publish: true
containerImage: ghcr.io/gafferhq/build/build:2.1.2
# GitHub container builds run as root. This causes failures for tests that
# assert that filesystem permissions are respected, because root doesn't
# respect permissions. So we run the final test suite as a dedicated
# test user rather than as root.
testRunner: su testUser -c
sconsCacheMegabytes: 400

- name: linux-debug-gcc9
os: ubuntu-20.04
buildType: DEBUG
publish: false
containerImage: ghcr.io/gafferhq/build/build:2.1.2
testRunner: su testUser -c
testArguments: -excludedCategories performance
# Debug builds are ludicrously big, so we must use a larger cache
# limit. In practice this compresses down to 4-500Mb.
sconsCacheMegabytes: 2500

- name: linux-gcc11
os: ubuntu-20.04
buildType: RELEASE
publish: true
containerImage: ghcr.io/gafferhq/build/build:3.0.0
# GitHub container builds run as root. This causes failures for tests that
# assert that filesystem permissions are respected, because root doesn't
# respect permissions. So we run the final test suite as a dedicated
# test user rather than as root.
testRunner: su testUser -c
sconsCacheMegabytes: 400
# - name: linux-gcc9
# os: ubuntu-20.04
# buildType: RELEASE
# publish: true
# containerImage: ghcr.io/gafferhq/build/build:2.1.2
# # GitHub container builds run as root. This causes failures for tests that
# # assert that filesystem permissions are respected, because root doesn't
# # respect permissions. So we run the final test suite as a dedicated
# # test user rather than as root.
# testRunner: su testUser -c
# sconsCacheMegabytes: 400

# - name: linux-debug-gcc9
# os: ubuntu-20.04
# buildType: DEBUG
# publish: false
# containerImage: ghcr.io/gafferhq/build/build:2.1.2
# testRunner: su testUser -c
# testArguments: -excludedCategories performance
# # Debug builds are ludicrously big, so we must use a larger cache
# # limit. In practice this compresses down to 4-500Mb.
# sconsCacheMegabytes: 2500

# - name: linux-gcc11
# os: ubuntu-20.04
# buildType: RELEASE
# publish: true
# containerImage: ghcr.io/gafferhq/build/build:3.0.0
# # GitHub container builds run as root. This causes failures for tests that
# # assert that filesystem permissions are respected, because root doesn't
# # respect permissions. So we run the final test suite as a dedicated
# # test user rather than as root.
# testRunner: su testUser -c
# sconsCacheMegabytes: 400

- name: windows
os: windows-2019
Expand Down Expand Up @@ -100,7 +101,7 @@ jobs:

- name: Install toolchain (Windows)
run: |
python -m pip install scons
python -m pip install scons sphinx==4.3.1 sphinx_rtd_theme==1.0.0 myst-parser==0.15.2 docutils==0.17.1 sphinxcontrib-applehelp==1.0.2 sphinxcontrib-devhelp==1.0.2 sphinxcontrib-htmlhelp==2.0.0 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-serializinghtml==1.1.5 sphinxcontrib-qthelp==1.0.3
Invoke-WebRequest -Uri "https://inkscape.org/gallery/item/37363/inkscape-1.2.2_2022-12-09_732a01da63-x64.exe" -OutFile "inkscape.exe"
Start-Process .\inkscape.exe /S -NoNewWindow -Wait
shell: pwsh
Expand Down Expand Up @@ -174,15 +175,15 @@ jobs:
env:
PYTHONUTF8: 1

- name: Test
# Tests should complete in well under an hour. If they don't it's most likely because
# of a hang, in which case we'd like to know more quickly than the default 6hr timeout
# allows.
timeout-minutes: 60
run: |
echo "::add-matcher::./.github/workflows/main/problemMatchers/unittest.json"
${{ matrix.testRunner }} "${{ env.GAFFER_BUILD_DIR }}/bin/gaffer test ${{ matrix.testArguments }}"
echo "::remove-matcher owner=unittest::"
# - name: Test
# # Tests should complete in well under an hour. If they don't it's most likely because
# # of a hang, in which case we'd like to know more quickly than the default 6hr timeout
# # allows.
# timeout-minutes: 60
# run: |
# echo "::add-matcher::./.github/workflows/main/problemMatchers/unittest.json"
# ${{ matrix.testRunner }} "${{ env.GAFFER_BUILD_DIR }}/bin/gaffer test ${{ matrix.testArguments }}"
# echo "::remove-matcher owner=unittest::"

- name: Build and test Arnold extension
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main/sconsOptions
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ if sys.platform == "win32" :
LOCATE_DEPENDENCY_PYTHONPATH=os.path.join(os.environ["GAFFER_BUILD_DIR"], "python")
GLEW_LIB_SUFFIX = "32"
INKSCAPE = "C:\\Program Files\\Inkscape\\bin\\inkscape.exe"
SPHINX = "noSphinxYet"
SPHINX = "C:\\hostedtoolcache\\windows\\Python\\3.7.9\\x64\\Scripts\\sphinx-build.exe"
16 changes: 9 additions & 7 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -2182,13 +2182,15 @@ def generateDocs( target, source, env ) :
localFile = os.path.basename( str(source[0]) )

ext = os.path.splitext( localFile )[1]
gafferCmd = shutil.which( "gaffer.cmd" if sys.platform == "win32" else "gaffer", path = env["ENV"]["PATH"] )

command = []
if localFile == "screengrab.py" :
command = [ "gaffer", "screengrab", "-commandFile", localFile ]
command = [ gafferCmd, "screengrab", "-commandFile", localFile ]
elif ext == ".py" :
command = [ "gaffer", "env", "python", localFile ]
command = [ gafferCmd, "env", "python", localFile ]
elif ext == ".sh" :
command = [ "gaffer", "env", "./" + localFile ]
command = [ gafferCmd, "env", "sh" if sys.patform == "win32" else "", "./" + localFile ]
if command :
sys.stdout.write( "Running {0}\n".format( os.path.join( root, localFile ) ) )
subprocess.check_call( command, cwd = root, env = env["ENV"] )
Expand Down Expand Up @@ -2257,7 +2259,7 @@ if haveSphinx and haveInkscape :
# use host python to avoid needing a matrix of sphinx versions to match Gaffer's
# bundled python version.
docEnv = env.Clone()
docEnv["ENV"]["PYTHONPATH"] = ":".join( sys.path )
docEnv["ENV"]["PYTHONPATH"] = os.path.pathsep.join( sys.path )

# Since we don't copy the docs reference scripts, the screengrab
# scripts must read them from the source, so we use the reference
Expand All @@ -2273,9 +2275,9 @@ if haveSphinx and haveInkscape :
libraryPathEnvVar = "DYLD_LIBRARY_PATH" if docEnv["PLATFORM"]=="darwin" else "LD_LIBRARY_PATH"

if docCommandEnv.subst( "$ARNOLD_ROOT" ) :
docCommandEnv["ENV"]["PATH"] += ":" + docCommandEnv.subst( "$ARNOLD_ROOT/bin" )
docCommandEnv["ENV"]["PYTHONPATH"] += ":" + docCommandEnv.subst( "$ARNOLD_ROOT/python" )
docCommandEnv["ENV"][libraryPathEnvVar] = docCommandEnv["ENV"].get( libraryPathEnvVar, "" ) + ":" + docCommandEnv.subst( "$ARNOLD_ROOT/bin" )
docCommandEnv["ENV"]["PATH"] += os.path.pathsep + docCommandEnv.subst( "$ARNOLD_ROOT/bin" )
docCommandEnv["ENV"]["PYTHONPATH"] += os.path.pathsep + docCommandEnv.subst( "$ARNOLD_ROOT/python" )
docCommandEnv["ENV"][libraryPathEnvVar] = docCommandEnv["ENV"].get( libraryPathEnvVar, "" ) + os.path.pathsep + docCommandEnv.subst( "$ARNOLD_ROOT/bin" )

# Docs graphics generation
docGraphicsCommands = graphicsCommands( docEnv, "resources/docGraphics.svg", "$BUILD_DIR/doc/gaffer/graphics" )
Expand Down
4 changes: 2 additions & 2 deletions doc/source/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

set -e

cp ../../resources/GafferLogo.svg _static
cp ../../resources/GafferLogoMini.svg _static
cp $GAFFER_ROOT/graphics/GafferLogo.svg _static
cp $GAFFER_ROOT/graphics/GafferLogoMini.svg _static

0 comments on commit 2387a96

Please sign in to comment.