Skip to content

Commit

Permalink
attempt to get files_changed
Browse files Browse the repository at this point in the history
  • Loading branch information
classiqdor committed May 7, 2024
1 parent cef3177 commit 6c3eaee
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:
jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 2
timeout-minutes: 10

steps:
- uses: actions/checkout@v4
Expand Down
38 changes: 32 additions & 6 deletions .github/workflows/test-notebooks.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
name: "Test notebooks"

on: [push, workflow_dispatch]

concurrency:
group: ${{ github.repository }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: true
on: [pull_request, workflow_dispatch]

jobs:
tests:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set up Python
uses: actions/setup-python@v5
with:
Expand All @@ -19,5 +17,33 @@ jobs:
run: |
python -m pip install -U -r requirements.txt
python -m pip install -U pytest
- name: Get changed files
id: changed-files
run: |
if ${{ github.event_name == 'pull_request' }}; then
echo "changed_files=$(git diff --name-only HEAD^ HEAD | xargs)" >> $GITHUB_OUTPUT
fi
- name: List changed files
run: |
for file in ${{ steps.changed-files.outputs.changed_files }}; do
echo "$file was changed"
done
- name: Get changed files - all
id: changed-files-all
uses: tj-actions/changed-files@v44
- name: Get changed files - ipynb
id: changed-files-ipynb
uses: tj-actions/changed-files@v44
with:
files: |
**.ipynb
- name: 'Run tests'
run: python -m pytest tests
env:
HAS_ANY_FILE_CHANGED: "${{ steps.changed-files-all.outputs.any_changed }}"
LIST_OF_FILE_CHANGED: "${{ steps.changed-files-all.outputs.all_changed_files }}"
HAS_ANY_IPYNB_CHANGED: "${{ steps.changed-files-ipynb.outputs.any_changed }}"
LIST_OF_IPYNB_CHANGED: "${{ steps.changed-files-ipynb.outputs.all_changed_files }}"
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[tool.pytest.ini_options]
python_files = "test_*.py"
timeout_method = "thread"

[tool.isort]
profile = "black"
Expand Down

0 comments on commit 6c3eaee

Please sign in to comment.