Skip to content

Commit

Permalink
Make build-subrepos.yml a reusable workflow.
Browse files Browse the repository at this point in the history
Do not run on pull requests, rather have installers-conda.yml run on limited PRs and call build-subrepos.yml.

build-subrepos.yml will run on push to master if relevant files have changed, providing caches for any PR based off of master. PRs that trigger the installer workflow will trigger build-subrepos from within the installer workflow, ensuring that it is completed before the build installers step. If caches already exist and the subrepos do not need to be rebuilt, build-subrepos should complete rapidly.
  • Loading branch information
mrclary committed Sep 14, 2023
1 parent ea9dd46 commit 903acff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/build-subrepos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ on:
- '**.gitrepo'
- '.github/workflows/build-subrepos.yml'

pull_request:
paths:
- '**.gitrepo'
- '.github/workflows/build-subrepos.yml'
workflow_call:

workflow_dispatch:

Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/installers-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
paths:
- 'installers-conda/**'
- '.github/workflows/installers-conda.yml'
- '.github/workflows/build-subrepos.yml'
- 'requirements/*.yml'
- 'MANIFEST.in'

Expand Down Expand Up @@ -86,11 +85,18 @@ jobs:
echo "target_platform=[$target_platform]" >> $GITHUB_OUTPUT
echo "include=[$include]" >> $GITHUB_OUTPUT
build-subrepos:
name: Build Subrepos
if: github.event_name == 'pull_request' || github.event == 'schedule' || (github.event_name == 'workflow_dispatch' && ! inputs.pre)
uses: ./.github/workflows/build-subrepos.yml

build-installers:
name: Build installer for ${{ matrix.target-platform }} Python-${{ matrix.python-version }}
if: ${{ ! failure() && ! cancelled() }}
runs-on: ${{ matrix.os }}
needs:
- build-matrix
- build-subrepos
strategy:
fail-fast: false
matrix:
Expand Down

0 comments on commit 903acff

Please sign in to comment.