diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..ecad092 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,22 @@ +version: 2 +enable-beta-ecosystems: true # required for the conda ecosystem +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + commit-message: + prefix: ⬆️ + - package-ecosystem: conda + directory: / + schedule: + interval: weekly + commit-message: + prefix: ⬆️ + ignore: + - dependency-name: jupyter-book + # jupyter-book 2.x is the MyST-MD rewrite and is not a drop-in + # upgrade for the Sphinx-based 1.x pipeline this repo uses. + versions: ['>=2.0'] + - dependency-name: python + # Python version is constrained by the anaconda distribution diff --git a/.github/workflows/cache.yml b/.github/workflows/cache.yml index 5b49b2b..88ada8a 100644 --- a/.github/workflows/cache.yml +++ b/.github/workflows/cache.yml @@ -3,6 +3,9 @@ on: schedule: - cron: '0 2 * * 1' # Every Monday at 2am UTC workflow_dispatch: # Manual trigger when needed + push: + branches: [main] + paths: [environment.yml] # Rebuild cache when the environment changes jobs: build: @@ -15,12 +18,12 @@ jobs: packages: read steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 - name: Build and Cache Lectures uses: quantecon/actions/build-jupyter-cache@v0.6.0 with: - builder: 'html' + builders: 'html' create-issue-on-failure: true diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index def98e5..8729f14 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: packages: read steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 @@ -29,7 +29,7 @@ jobs: upload-failure-reports: true - name: Upload Build Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: html-build path: ${{ steps.build.outputs.build-path }} diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml new file mode 100644 index 0000000..0f890d6 --- /dev/null +++ b/.github/workflows/linkcheck.yml @@ -0,0 +1,53 @@ +name: Link Checker +on: + schedule: + # Weekly on Sunday 23:00 UTC (Monday morning in Australia) + - cron: '0 23 * * 0' + workflow_dispatch: + +jobs: + linkcheck: + runs-on: ubuntu-latest + permissions: + issues: write # required for peter-evans/create-issue-from-file + steps: + # This repo deploys GitHub Pages via the artifact workflow (OIDC), so + # there is no gh-pages branch to check out — mirror the live site instead. + - name: Mirror published site + id: mirror + run: | + wget --quiet --recursive --no-parent --no-host-directories \ + --accept html https://dp.quantecon.org/ || true + count=$(find . -name '*.html' | wc -l | tr -d ' ') + echo "Mirrored $count HTML file(s) from https://dp.quantecon.org/" + if [ "$count" -eq 0 ]; then + # Mirror failed (site down or wget broke). Don't run lychee against + # an empty mirror and report green — surface the failure instead. + echo "ok=false" >> "$GITHUB_OUTPUT" + mkdir -p lychee + { + echo "## Link Checker — mirror failed" + echo + echo "\`wget\` mirrored **0 HTML files** from https://dp.quantecon.org/, so the link check did not run." + echo "The live site may be down, or the mirror step may be broken — please investigate." + } > lychee/out.md + else + echo "ok=true" >> "$GITHUB_OUTPUT" + fi + + - name: Link Checker + id: lychee + if: steps.mirror.outputs.ok == 'true' + uses: lycheeverse/lychee-action@v2 + with: + fail: false + args: --accept 403,503 '**/*.html' + + # Open an issue if the mirror failed, or if lychee found broken links. + - name: Create Issue From File + if: steps.mirror.outputs.ok != 'true' || steps.lychee.outputs.exit_code != 0 + uses: peter-evans/create-issue-from-file@v6 + with: + title: Link Checker Report + content-filepath: ./lychee/out.md + labels: report, automated issue, linkchecker diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index cdc1e84..da826a7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,7 +26,7 @@ jobs: packages: read steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: fetch-depth: 0 @@ -41,7 +41,7 @@ jobs: upload-failure-reports: true - name: Upload Build Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: html-build path: ${{ steps.build.outputs.build-path }} @@ -59,7 +59,7 @@ jobs: url: ${{ steps.deployment.outputs.page-url }} steps: - name: Download Build Artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v6 with: name: html-build path: _build/html diff --git a/environment.yml b/environment.yml index a53d533..8802fec 100644 --- a/environment.yml +++ b/environment.yml @@ -11,7 +11,7 @@ dependencies: - sphinx-tojupyter==0.6.0 - sphinxext-rediraffe==0.3.0 - sphinx-exercise==1.2.1 - - sphinx-proof==0.3.0 - - sphinxcontrib-youtube==1.4.1 - - sphinx-togglebutton==0.3.2 + - sphinx-proof==0.4.0 + - sphinxcontrib-youtube==1.5.0 + - sphinx-togglebutton==0.4.5 - sphinx-reredirects==1.1.0 diff --git a/lectures/_config.yml b/lectures/_config.yml index 5861734..692737b 100644 --- a/lectures/_config.yml +++ b/lectures/_config.yml @@ -87,8 +87,6 @@ sphinx: og_logo_url: https://assets.quantecon.org/img/qe-og-logo.png description: This website presents a set of lectures on dynamic programming, designed and written by Thomas J. Sargent and John Stachurski. keywords: Python, QuantEcon, Quantitative Economics, Economics, Dynamic Programming, Tom J. Sargent, John Stachurski - analytics: - google_analytics_id: G-XXXXXXXXXX launch_buttons: colab_url : https://colab.research.google.com intersphinx_mapping: