forked from microsoft/vscode-python
-
Notifications
You must be signed in to change notification settings - Fork 0
156 lines (136 loc) · 6.33 KB
/
pr_datascience.yml
File metadata and controls
156 lines (136 loc) · 6.33 KB
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
name: Pull Request DataScience
on:
pull_request:
branches:
- main
check_run:
types: [rerequested, requested_action]
env:
NODE_VERSION: 12.15.0
PYTHON_VERSION: 3.8
MOCHA_REPORTER_JUNIT: true # Use the mocha-multi-reporters and send output to both console (spec) and JUnit (mocha-junit-reporter). Also enables a reporter which exits the process running the tests if it haven't already.
CACHE_NPM_DEPS: cache-npm
CACHE_OUT_DIRECTORY: cache-out-directory
CACHE_PIP_DEPS: cache-pip
# Key for the cache created at the end of the the 'Cache ./pythonFiles/lib/python' step.
CACHE_PYTHONFILES: cache-pvsc-pythonFiles
COVERAGE_REPORTS: tests-coverage-reports
CI_PYTHON_PATH: python
TEST_RESULTS_DIRECTORY: .
TEST_RESULTS_GLOB: '**/test-results*.xml'
jobs:
tests:
name: Functional Jupyter Tests
runs-on: ${{ matrix.os }}
if: github.repository == 'microsoft/vscode-python'
strategy:
fail-fast: false
matrix:
# We're not running CI on macOS for now because it's one less matrix entry to lower the number of runners used,
# macOS runners are expensive, and we assume that Ubuntu is enough to cover the UNIX case.
os: [ubuntu-latest]
python: [3.8]
test-suite: [group1, group2, group3, group4]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Python ${{matrix.python}}
uses: actions/setup-python@v2
with:
python-version: ${{matrix.python}}
- name: Upgrade pip
run: python -m pip install -U pip
- name: Use Node ${{env.NODE_VERSION}}
uses: actions/setup-node@v2.1.1
with:
node-version: ${{env.NODE_VERSION}}
# Start caching
# Cache Python Dependencies.
# Caching (https://github.com/actions/cache/blob/main/examples.md#python---pip
- name: Cache pip on linux
uses: actions/cache@v2
if: matrix.os == 'ubuntu-latest'
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-${{ hashFiles('requirements.txt') }}-${{hashFiles('build/debugger-install-requirements.txt')}}-${{hashFiles('test-requirements.txt')}}-${{hashFiles('ipython-test-requirements.txt')}}-${{hashFiles('functional-test-requirements.txt')}}-${{hashFiles('conda-functional-requirements.txt')}}
restore-keys: |
${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-
- name: Cache pip on mac
uses: actions/cache@v2
if: matrix.os == 'macos-latest'
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-${{ hashFiles('requirements.txt') }}-${{hashFiles('build/debugger-install-requirements.txt')}}-${{hashFiles('test-requirements.txt')}}-${{hashFiles('ipython-test-requirements.txt')}}-${{hashFiles('functional-test-requirements.txt')}}-${{hashFiles('conda-functional-requirements.txt')}}
restore-keys: |
${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-
- name: Cache pip on windows
uses: actions/cache@v2
if: matrix.os == 'windows-latest'
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-${{ hashFiles('requirements.txt') }}-${{hashFiles('build/debugger-install-requirements.txt')}}-${{hashFiles('test-requirements.txt')}}-${{hashFiles('ipython-test-requirements.txt')}}-${{hashFiles('functional-test-requirements.txt')}}-${{hashFiles('conda-functional-requirements.txt')}}
restore-keys: |
${{ runner.os }}-pip-${{env.PYTHON_VERSION}}-
# Caching of npm packages (https://github.com/actions/cache/blob/main/examples.md#node---npm)
- name: Cache npm on linux/mac
uses: actions/cache@v2
if: matrix.os != 'windows-latest'
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Get npm cache directory
if: matrix.os == 'windows-latest'
id: npm-cache
run: |
echo "::set-output name=dir::$(npm config get cache)"
- name: Cache npm on windows
uses: actions/cache@v2
if: matrix.os == 'windows-latest'
with:
path: ${{ steps.npm-cache.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Cache compiled TS files
id: out-cache
uses: actions/cache@v2
with:
path: ./out
key: ${{runner.os}}-${{env.CACHE_OUT_DIRECTORY}}-${{hashFiles('src/**')}}
# For faster/better builds of sdists.
- run: python -m pip install wheel
shell: bash
# debugpy is not shipped, only installed for local tests.
# In production, we get debugpy from python extension.
- name: Install functional test requirements
run: |
python -m pip --disable-pip-version-check install -t ./pythonFiles/lib/python --no-cache-dir --implementation py --no-deps --upgrade -r ./requirements.txt
python -m pip --disable-pip-version-check install -r build/debugger-install-requirements.txt
python ./pythonFiles/install_debugpy.py
python -m pip install numpy
python -m pip install --upgrade jupyter
python -m pip install --upgrade -r build/test-requirements.txt
python -m pip install --upgrade -r ./build/ipython-test-requirements.txt
python -m pip install --upgrade -r ./build/conda-functional-requirements.txt
python -m ipykernel install --user
# This step is slow.
- name: Install dependencies (npm ci)
run: npm ci --prefer-offline
# This step is slow.
- name: Compile if not cached
run: npx gulp prePublishNonBundle
- name: Run functional tests
run: npm run test:functional:parallel -- --${{matrix.test-suite}}
env:
VSCODE_PYTHON_ROLLING: 1
VSC_PYTHON_FORCE_LOGGING: 1
id: test_functional_group
- name: Publish Test Report
uses: scacap/action-surefire-report@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
report_paths: ${{ env.TEST_RESULTS_GLOB }}
check_name: Functional Test Report
if: steps.test_functional_group.outcome == 'failure' && failure()