Skip to content

Commit

Permalink
CI : Disable GafferArnold for pull requests from forks
Browse files Browse the repository at this point in the history
In this case, the Arnold download authentication secrets aren't available, so we have no choice.
  • Loading branch information
johnhaddon committed Jan 4, 2024
1 parent 9a292bc commit 5419f8a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,12 @@ jobs:
ARNOLD_DOWNLOAD_USER: ${{ secrets.ARNOLD_DOWNLOAD_USER }}
ARNOLD_DOWNLOAD_PASSWORD: ${{ secrets.ARNOLD_DOWNLOAD_PASSWORD }}
shell: python
# We can't build GafferArnold for pull requests from forks, because the
# authentication secrets for downloading Arnold aren't available (this is
# a GitHub security restriction). The core development team can still build
# GafferArnold for pull requests by pushing a branch to the main repo and
# making a pull request from there.
if: ${{ env.ARNOLD_DOWNLOAD_USER != '' }}

- name: Build Docs and Package
# Docs builds should be relatively quick. If there is a problem, this
Expand All @@ -226,7 +232,7 @@ jobs:
- name: Validate
run: |
echo "::add-matcher::./.github/workflows/main/problemMatchers/validateRelease.json"
python ./config/validateRelease.py --archive ${{ env.GAFFER_BUILD_NAME }}.${{ env.PACKAGE_EXTENSION }} ${{ env.GAFFER_VALIDATE_EXTRA_FLAGS }}
python ./config/validateRelease.py --archive ${{ env.GAFFER_BUILD_NAME }}.${{ env.PACKAGE_EXTENSION }} ${{ env.GAFFER_VALIDATE_EXTRA_FLAGS }} ${{ env.ARNOLD_DOWNLOAD_USER == '' && '--skipPaths arnold' || '' }}
echo "::remove-matcher owner=validateRelease::"
if: matrix.publish

Expand Down
11 changes: 11 additions & 0 deletions config/validateRelease.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
help = "If set, validation will not check for documentation in the archive"
)

parser.add_argument(
"--skipPaths",
nargs = '+',
default = [],
help = "A list of paths to skip the checks for."
)

args = parser.parse_args()

if not os.path.exists( args.archive ) :
Expand Down Expand Up @@ -93,6 +100,10 @@
requiredPaths.append( os.path.join( "python", "GafferAppleseed" ) )
requiredPaths.append( os.path.join( "python", "%sUI" % "GafferAppleseed" ) )

for path in args.skipPaths :
if path in requiredPaths :
requiredPaths.remove( path )

rawMembers = []

if args.archive.endswith( ".tar.gz" ) :
Expand Down
2 changes: 1 addition & 1 deletion doc/source/Reference/NodeReference/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
import GafferArnoldUI
modules = [ GafferArnold ]
except ImportError :
modules = modules
modules = []

GafferUI.DocumentationAlgo.exportNodeReference( "./", modules = modules, modulePath = "$GAFFER_ROOT/python" )

0 comments on commit 5419f8a

Please sign in to comment.