Skip to content

remove dependabot #1423

remove dependabot

remove dependabot #1423

Workflow file for this run

name: PsyNeuLink Docs CI
on:
push:
branches-ignore:
- 'dependabot/**'
tags:
- 'v*'
pull_request:
jobs:
docs-build:
runs-on: ${{ 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.7).
matrix:
python-version: [3.7, 3.8, 3.9]
python-architecture: ['x64']
os: [ubuntu-latest, macos-latest, windows-latest]
event:
- ${{ github.event_name }}
pnl-version: ['head', 'base']
exclude:
- event: 'push'
pnl-version: 'base'
- os: macos-latest
pnl-version: 'base'
- os: windows-latest
pnl-version: 'base'
- python-version: 3.8
pnl-version: 'base'
- python-version: 3.9
pnl-version: 'base'
outputs:
on_master: ${{ steps.on_master.outputs.on-branch }}
steps:
- name: Checkout sources
uses: actions/checkout@v2.3.4
if: ${{ matrix.pnl-version == 'head' }}
with:
fetch-depth: 10
ref: ${{ github.ref }}
- name: Checkout pull base
uses: actions/checkout@v2.3.4
if: ${{ matrix.pnl-version == 'base' }}
with:
fetch-depth: 10
ref: ${{ github.base_ref }}
- name: Check if on master
if: ${{ github.event_name == 'push' }}
id: on_master
uses: ./.github/actions/on-branch
with:
branch: master
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.python-architecture }}
- name: Get pip cache location
shell: bash
id: pip_cache
run: |
python -m pip install -U pip
python -m pip --version
echo ::set-output name=pip_cache_dir::$(python -m pip cache dir)
- name: Wheels cache
uses: actions/cache@v2.1.6
with:
path: ${{ steps.pip_cache.outputs.pip_cache_dir }}/wheels
key: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ matrix.python-architecture }}-pip-wheels-v2-${{ github.sha }}
restore-keys: ${{ runner.os }}-python-${{ matrix.python-version }}-${{ matrix.python-architecture }}-pip-wheels-v2
# We need to install all PNL deps since docs config imports psyneulink module
- name: Install local, editable PNL package
uses: ./.github/actions/install-pnl
with:
features: 'doc'
- name: Add git tag
# The generated docs include PNL version,
# set it to a fixed value to prevent polluting the diff
if: ${{ github.event_name == 'pull_request' }}
run: git tag 'v999.999.999.999'
- name: Build Documentation
run: make -C docs/ html -e SPHINXOPTS="-aE -j auto"
- name: Upload Documentation
uses: actions/upload-artifact@v2.2.4
with:
name: Documentation-${{matrix.pnl-version}}-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.python-architecture }}
retention-days: 1
path: docs/build/html
- name: Store PR number
if: ${{ github.event_name == 'pull_request' }}
run: echo ${{ github.event.pull_request.number }} > ./pr_number.txt
- name: Upload PR number for other workflows
if: ${{ github.event_name == 'pull_request' }}
uses: actions/upload-artifact@v2.2.4
with:
name: pr_number
path: ./pr_number.txt
docs-deploy:
strategy:
fail-fast: false
matrix:
python-version: [3.7]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
needs: [docs-build]
if: github.event_name == 'push' &&
(github.ref == 'refs/heads/master' ||
github.ref == 'refs/heads/devel' ||
github.ref == 'refs/heads/docs' ||
(startsWith(github.ref, 'refs/tags/') && contains(needs.*.outputs.on_master, 'master'))
)
steps:
- name: Checkout docs
uses: actions/checkout@v2.3.4
with:
ref: gh-pages
- name: Download branch docs
uses: actions/download-artifact@v2
with:
name: Documentation-head-${{ matrix.os }}-${{ matrix.python-version }}-x64
path: _built_docs/${{ github.ref }}
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/docs'
- name: Update branch docs
shell: bash
run: |
mkdir -p branch
rm -rf "branch/${GITHUB_REF##*/}"
# Remove '.doctrees' and move to correct location
rm -rf "_built_docs/${GITHUB_REF}/.doctrees"
mv -f "_built_docs/${GITHUB_REF}" branch/
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/devel' || github.ref == 'refs/heads/docs'
- name: Download main docs
uses: actions/download-artifact@v2
with:
name: Documentation-head-${{ matrix.os }}-${{ matrix.python-version }}-x64
# This overwrites files in current directory
if: startsWith(github.ref, 'refs/tags/') && contains(needs.*.outputs.on_master, 'master')
- name: Update main docs
shell: bash
run: |
# Remove '.doctrees'
rm -rf ".doctrees"
if: startsWith(github.ref, 'refs/tags/') && contains(needs.*.outputs.on_master, 'master')
- name: Commit docs changes
shell: bash
run: |
# Commit changes to git
git add .
git config user.name "Documentation Bot"
git config user.email "doc-bot@psyneulink.princeton.edu"
git commit -m "Docs changes for $GITHUB_REF $GITHUB_SHA"
git push