Skip to content

Scheduled weekly dependency update for week 19 #246

Scheduled weekly dependency update for week 19

Scheduled weekly dependency update for week 19 #246

Workflow file for this run

# This GitHub workflow runs on every commit.
name: Pull request checks
on:
pull_request:
jobs:
# Check that source code is black-ified
black:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
name: Checkout repository
- uses: actions/setup-python@v4
name: Setup Python
with:
python-version: 3.9
- name: Install black
run: |
python -m pip install --upgrade pip
pip install black
- name: Run black
run: |
black --check .
# This job is copied over from `deploy.yaml`
build-environment:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
# See: https://github.com/marketplace/actions/setup-conda
- uses: s-weigand/setup-conda@v1
with:
conda-channels: "conda-forge"
# Build cache of environment
- name: Cache conda environment
id: cache-environment
uses: actions/cache@v3
# Conda environment build step depends on two files,
# so we ensure that the hash key contains both their hashes.
with:
path: |
nams.tar.gz
key: ${{ runner.os }}-${{ hashFiles('environment.yml') }}-${{ hashFiles('scripts/ci/build_environment.sh') }}-env
- name: Build environment
if: steps.cache-environment.outputs.cache-hit != 'true'
run: bash scripts/ci/build_environment.sh
# See: https://github.com/actions/upload-artifact
- name: Upload environment
uses: actions/upload-artifact@v3
with:
name: nams-tarball
path: nams.tar.gz
# This job is copied over from `deploy.yaml`
build-deploy-website:
runs-on: ubuntu-22.04
needs: build-environment
steps:
- uses: actions/checkout@v3
# https://github.com/actions/download-artifact
- name: Download environment tarball
uses: actions/download-artifact@v3
with:
name: nams-tarball
- name: Unpack environment and activate it
run: bash scripts/ci/unpack_environment.sh
# Build cache of website
- name: Cache website
id: cache-website
uses: actions/cache@v3
# Website build step depends on the following files:
# - mkdocs.yml
# - scripts/ci/build_website.sh
# - docs/
# - environment.yml
# so we ensure that the hash key contains all of their hashes.
with:
path: |
site
key: ${{ runner.os }}-mkdocs.${{ hashFiles('mkdocs.yml') }}-scripts.${{ hashFiles('scripts/ci/build_website.sh') }}-source.${{ hashFiles('notebooks') }}-env.${{ hashFiles('environment.yml') }}
- name: Build website
if: steps.cache-website.outputs.cache-hit != 'true'
run: |
bash scripts/ci/build_website.sh
# https://www.bradmcgonigle.com/blog/github-action-for-continuous-deployment
# - NETLIFY_SITE_ID maps to the netlify site's API ID
# - NETLIFY_AUTH_TOKEN maps to netlify's Personal Access Token that I set on a per-user basis
- name: Netlify PR preview
uses: netlify/actions/cli@master
with:
args: deploy --site ${{ secrets.NETLIFY_SITE_ID }} --auth ${{ secrets.NETLIFY_AUTH_TOKEN }} --dir=site/
# This job is copied over from `deploy.yaml`
build-deploy-leanpub:
runs-on: ubuntu-22.04
needs: build-environment
steps:
- uses: actions/checkout@v3
- name: Download environment tarball
uses: actions/download-artifact@v3
with:
name: nams-tarball
- name: Unpack environment and activate it
run: bash scripts/ci/unpack_environment.sh
# Build cache of leanpub source
- name: Cache LeanPub
id: cache-leanpub
uses: actions/cache@v3
# Leanpub build step depends on the following files:
# - scripts/bookbuilder
# - scripts/ci/build_website.sh
# - docs
# - environment.yml
# so we ensure that the hash key contains all of their hashes.
with:
path: |
site
key: ${{ runner.os }}-bookbuilder.${{ hashFiles('scripts/bookbuilder') }}-scripts.${{ hashFiles('scripts/ci/build_website.sh') }}-source.${{ hashFiles('notebooks') }}-env.${{ hashFiles('environment.yml') }}
- name: Build leanpub manuscript files
if: steps.cache-leanpub.outputs.cache-hit != 'true'
run: |
bash scripts/ci/build_leanpub.sh