@@ -6,6 +6,10 @@ on: # Trigger the workflow on push or pull request, but only for the main branc
66 pull_request :
77 branches : [main]
88
9+ defaults :
10+ run :
11+ shell : bash
12+
913jobs :
1014 pytest-internal :
1115
@@ -14,17 +18,32 @@ jobs:
1418 fail-fast : false
1519 matrix :
1620 os : [ubuntu-20.04 ]
17- python-version : ["3.9"]
21+ python-version : ["3.7", "3. 9"]
1822 # Timeout: https://stackoverflow.com/a/59076067/4521646
19- timeout-minutes : 10
23+ timeout-minutes : 15
2024
2125 steps :
2226 - uses : actions/checkout@v2
27+ with :
28+ fetch-depth : 0 # fetch all history for all branches and tags
2329 - name : Set up Python ${{ matrix.python-version }}
2430 uses : actions/setup-python@v2
2531 with :
2632 python-version : ${{ matrix.python-version }}
2733
34+ # Note: This uses an internal pip API and may not always work
35+ # https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
36+ - name : Get pip cache dir
37+ id : pip-cache
38+ run : echo "::set-output name=dir::$(pip cache dir)"
39+
40+ - name : pip cache
41+ uses : actions/cache@v2
42+ with :
43+ path : ${{ steps.pip-cache.outputs.dir }}
44+ key : ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('.actions/requirements.txt') }}-${{ hashFiles('requirements/default.txt') }}
45+ restore-keys : ${{ runner.os }}-pip-py${{ matrix.python-version }}-
46+
2847 - name : Install requirements
2948 run : |
3049 pip --version
@@ -33,22 +52,18 @@ jobs:
3352 # this is needed to be able to run package version parsing test
3453 pip install -q matplotlib -r requirements/default.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
3554
36- - name : Convert templates
55+ - name : Prepare dummy inputs
3756 run : |
3857 jupytext --set-formats ipynb,py:percent templates/simple/template.py
3958 jupytext --set-formats ipynb,py:percent templates/titanic/tutorial.py
4059 # mv templates/simple/template.ipynb templates/simple.ipynb
60+ git diff --name-only HEAD~3 > master-diff.txt
61+ python .actions/assistant.py list_dirs "" > dirs-b1.txt
62+ python .actions/assistant.py list_dirs --include_file_ext=".ipynb" > dirs-b2.txt
4163
4264 - name : Testing
4365 run : |
44- coverage run -m pytest .actions -v --junitxml="junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml"
45-
46- - name : Upload pytest test results
47- uses : actions/upload-artifact@v2
48- with :
49- name : pytest-results-${{ runner.os }}-${{ matrix.python-version }}
50- path : junit/test-results-${{ runner.os }}-${{ matrix.python-version }}.xml
51- if : failure()
66+ coverage run -m pytest .actions -v
5267
5368 - name : Statistics
5469 if : success()
0 commit comments