Skip to content

Commit

Permalink
Fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter committed Apr 13, 2024
1 parent 7deca13 commit e6197b9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/doc-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,17 @@ jobs:
--health-timeout 5s
--health-retries 5
steps:
- name: Get all changed docs files
id: changed-markdown-files
uses: tj-actions/changed-files@v43
with:
files: |
docs:
- docs/**.md
- name: Checkout actions
uses: actions/checkout@v3
- name: Init environment
uses: ./.github/actions/init-environment
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44
with:
files: |
**.md
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
Expand All @@ -129,7 +129,7 @@ jobs:
echo "$file was changed"
done
- name: Run integration tests
if: steps.changed-markdown-files.outputs.docs_any_changed == 'true'
if: steps.changed-files.outputs.any_changed == 'true'
run: pytest tests/integration/test_code_blocks.py
env:
DOCS_ALL_CHANGED_FILES: ${{ steps.changed-markdown-files.outputs.docs_all_changed_files }}
DOCS_ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
2 changes: 1 addition & 1 deletion tests/integration/test_code_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import pytest
from tests.utils.code_blocks import get_all_code_blocks, check_py_string

docs_all_changed_files = os.environ.get("DOCS_ALL_CHANGED_FILES", "").splitlines()
docs_all_changed_files = os.environ.get("DOCS_ALL_CHANGED_FILES", "").split()

all_code_blocks = [get_all_code_blocks(changed_file) for changed_file in docs_all_changed_files]
all_code_blocks = [block for sublist in all_code_blocks for block in sublist]
Expand Down
2 changes: 1 addition & 1 deletion tests/utils/code_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def get_code_blocks(docstring: str, lang: str = "python") -> list[str]:


def get_all_code_blocks(path: str) -> list[dict]:
fpath = pathlib.Path(path)
return [
{"id": f"{str(fpath)}-{block_num + 1}", "code": code_block}
for fpath in pathlib.Path("docs").glob(path)
for block_num, code_block in enumerate(get_code_blocks(fpath.read_text()))
]

0 comments on commit e6197b9

Please sign in to comment.