Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Lychee to check URLs #2734

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
19667b8
add lychee workflow
agriyakhetarpal Feb 26, 2023
8e93d0d
pin version with sha-256 hash for stable v1.6.1
agriyakhetarpal Feb 27, 2023
457f30e
add config file
agriyakhetarpal Feb 27, 2023
68cf5fd
add file formats to be checked
agriyakhetarpal Feb 27, 2023
333d1e8
use github API token because of timeouts
agriyakhetarpal Feb 27, 2023
3dfb9c0
oops, fix formatting error
agriyakhetarpal Feb 27, 2023
9d8c889
pin version and add cache job
agriyakhetarpal Feb 27, 2023
4c1d2cc
fix formatting
agriyakhetarpal Feb 27, 2023
b904f30
fix formatting again
agriyakhetarpal Feb 27, 2023
c396db5
reorder jobs schema, should fix run
agriyakhetarpal Feb 27, 2023
51745b3
exclude changelog from being checked
agriyakhetarpal Mar 4, 2023
0cfb2b3
and delete old URL checker workflow
agriyakhetarpal Mar 4, 2023
e782c3e
fix cache
agriyakhetarpal Mar 5, 2023
9cb4909
reduce max concurrency from 128 to 32
agriyakhetarpal Mar 5, 2023
a366d9a
accept status code 429 with max concurrency 128
agriyakhetarpal Mar 5, 2023
8ee9cbc
accept both 200 and 429
agriyakhetarpal Mar 5, 2023
cc35827
Merge branch 'pybamm-team:develop' into lychee-URL-checking
agriyakhetarpal Mar 5, 2023
fc86b7b
retry accepting 200 and 429
agriyakhetarpal Mar 7, 2023
af79897
fix accept status codes
agriyakhetarpal Mar 7, 2023
d751e7b
Move lychee args to correct position
mre Mar 7, 2023
961a12f
Merge pull request #1 from mre/patch-1
agriyakhetarpal Mar 7, 2023
67d42b6
Merge branch 'pybamm-team:develop' into lychee-URL-checking
agriyakhetarpal Mar 7, 2023
998dc1a
changelog
agriyakhetarpal Mar 7, 2023
8fcd5ff
trigger on push only on main and develop
Saransh-cpp Mar 7, 2023
e0f459a
exclude local links and pybamm twitter handle
agriyakhetarpal Mar 7, 2023
8e88fb2
fix links for license file and match ScienceDirect and DOI links with…
agriyakhetarpal Mar 7, 2023
589a9c0
Update lychee_url_checker.yml
agriyakhetarpal Mar 7, 2023
2c97aae
fix regex
agriyakhetarpal Mar 7, 2023
fc1b7a3
remove escape characters
agriyakhetarpal Mar 7, 2023
fb82592
Create .lycheeignore
agriyakhetarpal Mar 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
Saransh-cpp marked this conversation as resolved.
Show resolved Hide resolved
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