Skip to content

Commit

Permalink
Merge pull request #2639 from stfc/2638_linkspector
Browse files Browse the repository at this point in the history
(Closes #2638) add new linkspector workflow
  • Loading branch information
sergisiso authored Jul 1, 2024
2 parents 98e15d6 + 89b9dec commit 4d10caa
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 40 deletions.
13 changes: 13 additions & 0 deletions .github/linkspector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dirs:
- .
useGitIgnore: true
ignorePatterns:
- pattern: '^https://mybinder.org/v2/gh/stfc/psyclone'
replacementPatterns:
- pattern: '^https:\/\/(psyclone.*\.readthedocs\.io\/en)\/stable$'
replacement: 'https://$1/latest'
aliveStatusCodes:
- 200
- 401
- 502
- 503
16 changes: 16 additions & 0 deletions .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Linkspector
on: [pull_request]
jobs:
check-links:
if: ${{ github.repository != 'stfc/PSyclone-mirror' }}
name: Run linkspector
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run linkspector
uses: umbrelladocs/action-linkspector@v1
with:
github_token: ${{ secrets.github_token }}
reporter: github-pr-check
fail_on_error: true
config_file: '.github/linkspector.yml'
14 changes: 0 additions & 14 deletions .github/workflows/mlc_config.json

This file was deleted.

25 changes: 9 additions & 16 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,26 +52,17 @@ on:
workflow_dispatch:

jobs:
markdown-link-check:
if: ${{ github.repository != 'stfc/PSyclone-mirror' }}
# Check all markdown files for dead links. See the 'mlc_config.json'
# file in the project root directory for configuration.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
use-verbose-mode: 'yes'
config-file: '.github/workflows/mlc_config.json'
sphinx-link-check:
if: ${{ github.repository != 'stfc/PSyclone-mirror' }}
# Check all Sphinx documentation for dead links.
runs-on: ubuntu-latest
env:
GITHUB_PR_NUMBER: ${{ github.event.number }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: sudo apt-get install -y graphviz doxygen
- run: python -m pip install --upgrade pip
- run: pip install .[doc]
Expand All @@ -89,8 +80,10 @@ jobs:
# Check doctests of developer's guide
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: python -m pip install --upgrade pip
- run: pip install .[doc]
# Sphinx since version 7.2 (7.2.0/1/2) aborts with
Expand All @@ -108,7 +101,7 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.12]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
# This is required to get the commit history for merge commits for
Expand Down
2 changes: 2 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@

52) PR #2632 for #2116. Update the code-transformation tutorial.

53) PR #2639 for #2638. Upgrade CI markdown-linkcheck to linkspector.

release 2.5.0 14th of February 2024

1) PR #2199 for #2189. Fix bugs with missing maps in enter data
Expand Down
24 changes: 14 additions & 10 deletions doc/developer_guide/working_practises.rst
Original file line number Diff line number Diff line change
Expand Up @@ -439,26 +439,22 @@ triggered whenever there is a push to a pull-request on the repository
and consists of five main checks performed, in order of increasing
computational cost (so that we 'fail fast'):

1. All links within all MarkDown files are checked. Those links to skip
(because they are e.g. password protected) are specified in the
``PSyclone/.github/workflows/mlc_config.json`` configuration file.

2. All examples in the Developer Guide are checked for correctness by
1. All examples in the Developer Guide are checked for correctness by
running ``make doctest``.

3. The code base, examples and tutorials are lint'ed with flake8.
2. The code base, examples and tutorials are lint'ed with flake8.
(Configuration of flake8 is performed in ``setup.cfg``.)

4. All links within the Sphinx documentation (rst files) are checked (see
3. All links within the Sphinx documentation (rst files) are checked (see
note below);

5. All of the examples are tested (for Python versions 3.7, 3.8 and 3.12)
4. All of the examples are tested (for Python versions 3.7, 3.8 and 3.12)
using the ``Makefile`` in the ``examples`` directory. No compilation is
performed; only the ``transform`` (performs the PSyclone transformations)
and ``notebook`` (runs the various Jupyter notebooks) targets are used.
The ``transform`` target is run 2-way parallel (``-j 2``).

6. The full test suite is run for Python versions 3.7, 3.8 and 3.12 but
5. The full test suite is run for Python versions 3.7, 3.8 and 3.12 but
without the compilation checks. ``pytest`` is passed the ``-n auto`` flag
so that it will run the tests in parallel on as many cores as are
available (currently 2 on GHA instances).
Expand Down Expand Up @@ -488,7 +484,7 @@ and therefore the line described above must be commented out again
before making a release.

A single run of the test suite on GitHub Actions uses
approximately 20 minutes of CPU time and we run the test suite on three
approximately 15 minutes of CPU time and we run the test suite on three
different versions of Python. Therefore, it is good practise to avoid
triggering the tests unnecessarily (e.g. when we know that a certain commit
won't pass). This may be achieved by including the "[skip ci]" tag (without
Expand All @@ -497,6 +493,14 @@ the quotes) in the associated commit message.
Link checking
-------------

Link checking for all of the MarkDown files is performed using the
linkspector GitHub Action which has its own workflow file,
``linkspector.yml``. Those links to skip (because they are e.g. password
protected) are specified in the ``PSyclone/.github/linkspector.yml``
configuration file. That file also ensures that links to the PSyclone
documentation are always checked against the 'latest' version on
ReadTheDocs rather than 'stable'.

The link checking performed for the Sphinx documentation
uses Sphinx's `linkcheck` functionality. Some URLs are excluded from
this checking (due to ssl issues with an outdated http server or pages
Expand Down

0 comments on commit 4d10caa

Please sign in to comment.