-
Notifications
You must be signed in to change notification settings - Fork 92
145 lines (121 loc) · 4.56 KB
/
positron-python-nightly.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
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
name: 'Nightly: Python CI'
# Run builds daily at 2am UTC (10p EST) on weekdays for now, or manually
on:
schedule:
- cron: "0 2 * * 1-5"
workflow_dispatch:
defaults:
run:
working-directory: 'extensions/positron-python'
env:
NODE_VERSION: '18.17.1'
PYTHON_VERSION: '3.10'
PROJECT_DIR: 'extensions/positron-python'
PYTHON_SRC_DIR: 'extensions/positron-python/python_files'
# Force a path with spaces and to test extension works in these scenarios
# Unicode characters are causing 2.7 failures so skip that for now.
special-working-directory: './path with spaces'
special-working-directory-relative: 'path with spaces'
jobs:
# Run full suite of upstream tests
vscode-python-tests:
name: 'vscode-python'
# The value of runs-on is the OS of the current job (specified in the strategy matrix below) instead of being hardcoded.
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: ${{ env.special-working-directory }}/${{ env.PROJECT_DIR}}
strategy:
fail-fast: false
matrix:
include:
- os: 'ubuntu-latest'
python: '3.8'
- os: 'ubuntu-latest'
python: '3.9'
- os: 'windows-latest'
python: '3.10'
- os: 'ubuntu-latest'
python: '3.11'
- os: 'ubuntu-latest'
python: '3.12'
# add in 3.13 when ibis-framework[duckdb] supports it
# - os: 'ubuntu-latest'
# python: '3.13'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: ${{ env.special-working-directory-relative }}
- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install specific pytest version
run: |
python -m pip install pytest
- name: Install specific pytest version
run: python -m pytest --version
- name: Install base Python requirements
run: 'python -m pip install --no-deps --require-hashes --only-binary :all: -t ./python_files/lib/python --no-cache-dir --implementation py -r requirements.txt'
- name: Install test requirements
run: python -m pip install -r build/test-requirements.txt
- name: Run Python unit tests
run: python python_files/tests/run_all.py --junit-xml=python-unit-test-results.xml
- name: Upload test artifacts
uses: actions/upload-artifact@v4
with:
name: upstream-test-output-${{ matrix.os }}-${{ matrix.python }}
path: ${{ github.workspace }}/${{ env.special-working-directory-relative }}/extensions/positron-python/python-unit-test-results.xml
# Install the latest releases of test dependencies
ipykernel-tests-latest:
name: 'ipykernel'
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: 'ubuntu-latest'
python: '3.8'
- os: 'macos-13'
python: '3.9'
- os: 'windows-latest'
python: '3.10'
- os: 'ubuntu-latest'
python: '3.11'
- os: 'ubuntu-latest'
python: '3.12'
# add in 3.13 when ibis-framework[duckdb] supports it
# - os: 'ubuntu-latest'
# python: '3.13'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: 'pip'
- name: Install Positron IPyKernel requirements
run: python scripts/vendor.py
- name: Install latest versions Positron IPyKernel test requirements
run: python -m pip install --prefer-binary --upgrade -r python_files/positron/test-requirements.txt
- name: Run Positron IPyKernel unit tests
run: pytest python_files/positron --junit-xml=python-test-results.xml
- name: Upload test artifacts
uses: actions/upload-artifact@v4
with:
name: ipykernel-test-output-${{ matrix.os }}-${{ matrix.python }}
path: extensions/positron-python/python-test-results.xml
slack-notification:
name: 'Send Slack notification'
runs-on: ubuntu-latest
needs: [vscode-python-tests, ipykernel-tests-latest]
if: always()
steps:
- name: Send Slack Notification
uses: midleman/slack-workflow-status@master
with:
repo_token: ${{ secrets.POSITRON_GITHUB_PAT }}
slack_webhook_url: ${{ secrets.SLACK_TEST_RESULTS_WEBHOOK_URL }}
include_jobs_time: "false"
notify_on: "failure"