-
Notifications
You must be signed in to change notification settings - Fork 13
69 lines (64 loc) · 1.7 KB
/
check-examples.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
name: Check example notebooks
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# 04:00 every Saturday morning
- cron: '0 4 * * 6'
env:
PYTKET_REMOTE_QUANTINUUM_USERNAME: ${{ secrets.PYTKET_REMOTE_QUANTINUUM_USERNAME }}
PYTKET_REMOTE_QUANTINUUM_PASSWORD: ${{ secrets.PYTKET_REMOTE_QUANTINUUM_PASSWORD }}
jobs:
changes:
runs-on: ubuntu-latest
outputs:
examples: ${{ steps.filter.outputs.examples }}
steps:
- uses: actions/checkout@v4
- uses: dorny/[email protected]
id: filter
with:
base: ${{ github.ref }}
filters: |
examples:
- 'examples/**'
- '.github/**'
check:
name: Check notebooks
needs: changes
if: |
github.event_name == 'schedule' ||
github.event_name == 'push' ||
(
github.event_name == 'pull_request' &&
needs.changes.outputs.examples == 'true'
)
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install required python packages
run: |
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install -e .
python -m pip install p2j jupyter
python -m pip install -r examples/requirements.txt
- name: Install expect tool
run: |
sudo apt-get update
sudo apt-get install expect
- name: test example notebooks
run: |
cd examples
./check-examples