Skip to content

Commit

Permalink
Devops: Fix the test-install.yml workflow (#6409)
Browse files Browse the repository at this point in the history
* The `uses` key requires full relative path when using a local path
  to include, i.e., the leading `./` is required in the following:
   
      used: `./.github/actions/install-aiida-core

* The action `upload-artifact@v4` no longer supports uploading multiple
  files with the same name, so they now include the Python version.

* The Sphinx extension test is made more robust by making it insensitive
  to the version of docutils used.
  • Loading branch information
danielhollas authored May 22, 2024
1 parent 04b3260 commit 22ea063
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ jobs:
run: sudo apt update && sudo apt install postgresql graphviz

- name: Install aiida-core
uses: .github/actions/install-aiida-core
uses: ./.github/actions/install-aiida-core
with:
python-version: ${{ matrix.python-version }}
extras: '[atomic_tools, docs, notebook, rest, tests, tui]'
extras: '[atomic_tools,docs,notebook,rest,tests,tui]'
from-requirements: 'false'

- name: Setup AiiDA environment
Expand All @@ -239,7 +239,7 @@ jobs:
# updating the requirements (in case they are inconsistent with the pyproject.toml file).
- uses: actions/upload-artifact@v4
with:
name: requirements.txt
name: requirements-py-${{ matrix.python-version }}.txt
path: requirements-py-${{ matrix.python-version }}.txt

# Check whether the requirements/ files are consistent with the dependency specification in the pyproject.toml file.
Expand Down Expand Up @@ -293,7 +293,8 @@ jobs:
if: steps.check_reqs.outcome == 'Failure' # only run if requirements/ are inconsistent
uses: actions/download-artifact@v4
with:
name: requirements.txt
pattern: requirements-py-*
merge-multiple: true
path: requirements

- name: Commit requirements files
Expand Down
1 change: 1 addition & 0 deletions tests/sphinxext/test_workchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def test_workchain_build(sphinx_build_factory, file_regression):
# Need to remove the ``source`` attribute of the ``document`` tag as that is variable.
output = (sphinx_build.outdir / 'index.xml').read_text()
output = re.sub(r'source=".*"', '', output)
output = re.sub(r'<!-- Generated by Docutils.*-->', '<!-- Generated by Docutils -->', output)

file_regression.check(output, encoding='utf-8', extension='.xml')

Expand Down
2 changes: 1 addition & 1 deletion tests/sphinxext/test_workchain/test_workchain_build.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE document PUBLIC "+//IDN docutils.sourceforge.net//DTD Docutils Generic//EN//XML" "http://docutils.sourceforge.net/docs/ref/docutils.dtd">
<!-- Generated by Docutils 0.20.1 -->
<!-- Generated by Docutils -->
<document >
<section ids="sphinx-aiida-demo" names="sphinx-aiida\ demo">
<title>sphinx-aiida demo</title>
Expand Down

0 comments on commit 22ea063

Please sign in to comment.