Skip to content

Commit

Permalink
Merge pull request #2734 from agriyakhetarpal/lychee-URL-checking
Browse files Browse the repository at this point in the history
Migrate to Lychee to check URLs
  • Loading branch information
valentinsulzer authored Mar 8, 2023
2 parents f45f4a5 + fb82592 commit 3078360
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 35 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/lychee_url_checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Check URLs with Lychee

on:
push:
branches:
- main
- develop
pull_request:
schedule:
# Run everyday at 3 am UTC
- cron: "0 3 * * *"

jobs:
linkChecker:
runs-on: ubuntu-latest
steps:

# cache Lychee results to avoid hitting rate limits
- name: Restore lychee cache
uses: actions/cache@v3
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-

# check URLs with Lychee
- uses: actions/checkout@v3

# use stable version for now to avoid breaking changes
- name: Lychee URL checker
uses: lycheeverse/[email protected]
with:
# arguments with file types to check
args: >-
--cache
--no-progress
--max-cache-age 2d
--timeout 10
--max-retries 5
--skip-missing
--exclude-loopback
--exclude https://twitter.com/pybamm_
--exclude "https://doi\.org|www.sciencedirect\.com/*"
--accept 200,429
--exclude-path ./CHANGELOG.md
--exclude-path ./scripts/update_version.py
'./**/*.rst'
'./**/*.md'
'./**/*.py'
'./**/*.ipynb'
# fail the action on broken links
fail: true
env:
# to be used in case rate limits are surpassed
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
34 changes: 0 additions & 34 deletions .github/workflows/url_checker.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# a list of links/files to be ignored by lychee link checker (see workflow file)

# Errors in docs/source/user_guide/getting_started.md
file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/api_docs

# Errors in docs/source/user_guide/fundamentals/index.md
file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/fundamentals/base_battery_model
file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/fundamentals/parameter_sets
file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/fundamentals/quick_plot
file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/fundamentals/plot_voltage_components

# Errors in docs/source/user_guide/index.md
file:///home/runner/work/PyBaMM/PyBaMM/docs/source/user_guide/api_docs

# Errors in examples/notebooks/README.md
file:///home/runner/work/PyBaMM/PyBaMM/examples/notebooks/using-submodels.ipynb
file:///home/runner/work/PyBaMM/PyBaMM/examples/notebooks/create-model.ipynb
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@

- Fixed `plot_voltage_components` so that the sum of overpotentials is now equal to the voltage ([#2740](https://github.com/pybamm-team/PyBaMM/pull/2740))

## Optimizations

- Migrated to [Lychee](https://github.com/lycheeverse/lychee-action) workflow for checking URLs [#2734](https://github.com/pybamm-team/PyBaMM/pull/2734)

## Breaking changes

- Renamed "Measured open circuit voltage [V]" to "Surface open-circuit voltage [V]". This variable was calculated from surface particle concentrations, and hence "hid" the overpotential from particle gradients. The new variable "Open-circuit voltage [V]" is calculated from bulk particle concentrations instead. ([#2740](https://github.com/pybamm-team/PyBaMM/pull/2740))
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ Editable notebooks are made available using [Google Colab](https://colab.researc
GitHub does some magic with particular filenames. In particular:

- The first page people see when they go to [our GitHub page](https://github.com/pybamm-team/PyBaMM) displays the contents of [README.md](README.md), which is written in the [Markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) format. Some guidelines can be found [here](https://help.github.com/articles/about-readmes/).
- The license for using PyBaMM is stored in [LICENSE](LICENSE), and [automatically](https://help.github.com/articles/adding-a-license-to-a-repository/) linked to by GitHub.
- The license for using PyBaMM is stored in [LICENSE](LICENSE.txt), and [automatically](https://help.github.com/articles/adding-a-license-to-a-repository/) linked to by GitHub.
- This file, [CONTRIBUTING.md](CONTRIBUTING.md) is recognised as the contribution guidelines and a link is [automatically](https://github.com/blog/1184-contributing-guidelines) displayed when new issues or pull requests are created.

## Acknowledgements
Expand Down

0 comments on commit 3078360

Please sign in to comment.