-
Notifications
You must be signed in to change notification settings - Fork 80
71 lines (62 loc) · 2.27 KB
/
ci_internal.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: CI internal
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the main branch
push:
branches: [main]
pull_request:
branches: [main]
defaults:
run:
shell: bash
jobs:
pytest-internal:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
python-version: ["3.8", "3.10"]
# Timeout: https://stackoverflow.com/a/59076067/4521646
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history for all branches and tags
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
- name: Install requirements
run: |
pip install -q -r .actions/requires.txt -r _requirements/test.txt
# this is needed to be able to run package version parsing test
pip install -q -r _requirements/devel.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
pip list
- name: Prepare dummy inputs
run: |
jupytext --set-formats ipynb,py:percent templates/simple/template.py
# jupytext --set-formats ipynb,py:percent templates/titanic/tutorial.py # ToDo: pull it back when Kaggle datasets are back
# mv templates/simple/template.ipynb templates/simple.ipynb
git diff --name-only HEAD~3 > master-diff.txt
python .actions/assistant.py list_dirs "" > dirs-b1.txt
python .actions/assistant.py list_dirs --include_file_ext=".ipynb" > dirs-b2.txt
- name: Testing
run: |
coverage run -m pytest .actions -v
- name: Statistics
if: success()
run: |
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
if: always()
# see: https://github.com/actions/toolkit/issues/399
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
flags: pytest,${{ runner.os }}
name: CLI-coverage
fail_ci_if_error: false