forked from QuTech-Delft/OpenQL
-
Notifications
You must be signed in to change notification settings - Fork 1
170 lines (165 loc) · 5.09 KB
/
test.yml
File metadata and controls
170 lines (165 loc) · 5.09 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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Test
on:
push:
branches:
- develop
pull_request:
jobs:
cpp:
name: 'C++ tests'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
if: matrix.os == 'macos-latest'
run: |
brew install bison flex
echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH
echo "/usr/local/opt/flex/bin" >> $GITHUB_PATH
- uses: actions/cache@v2
if: matrix.os == 'windows-latest'
with:
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
key: ${{ runner.os }}-chocolatey-cpp-0
restore-keys: |
${{ runner.os }}-chocolatey-cpp-
${{ runner.os }}-chocolatey-
- name: Install dependencies
if: matrix.os == 'windows-latest'
run: choco install winflexbison3 --version 2.5.18.20190508
- name: Configure
run: cmake . -DCMAKE_BUILD_TYPE=Debug -DOPENQL_BUILD_TESTS=ON -DBUILD_SHARED_LIBS=OFF
- name: Build
run: cmake --build . --parallel 5
- name: Test
run: ctest -C Debug --output-on-failure
cpp-standalone:
name: 'C++ standalone program'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Configure
run: |
mkdir cbuild
cd cbuild && cmake ../examples/cpp-standalone-example
- name: Build
run: make -C cbuild -j 5
- name: Test
run: cd tests && ../cbuild/example
python:
name: Python
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
python:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: python -m pip install --upgrade pip setuptools wheel pytest numpy
- name: Install dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y swig
- name: Install dependencies
if: matrix.os == 'macos-latest'
run: |
brew install bison flex swig xquartz
echo "/usr/local/opt/bison/bin" >> $GITHUB_PATH
echo "/usr/local/opt/flex/bin" >> $GITHUB_PATH
- uses: actions/cache@v2
if: matrix.os == 'windows-latest'
with:
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
key: ${{ runner.os }}-chocolatey-python-1
restore-keys: |
${{ runner.os }}-chocolatey-python-
${{ runner.os }}-chocolatey-
- name: Install dependencies
if: matrix.os == 'windows-latest'
shell: powershell
run: |
choco install winflexbison3 --version 2.5.18.20190508
- name: Select build type
if: matrix.os == 'windows-latest'
shell: powershell
run: echo "OPENQL_BUILD_TYPE=Release" >> $GITHUB_ENV
- name: Select build type
if: matrix.os != 'windows-latest'
run: echo "OPENQL_BUILD_TYPE=Debug" >> $GITHUB_ENV
- name: Build
env:
NPROCS: 5
run: python -m pip install --verbose .
- name: Test
run: python -m pytest
# NOTE: disabled conda completely because it is INCREDIBLY slow on CI (multiple
# hours!) and occasionally just breaks the runners entirely after ~6 hours. It
# also doesn't appear like anyone is actually using Conda within the lab
# (anymore), as everything goes through pycQED and it is pip-only.
#
# conda:
# name: Conda
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os:
# - ubuntu-latest
# - macos-latest
# #- windows-latest
# #- windows-2016
# steps:
# - uses: actions/checkout@v2
# with:
# submodules: recursive
# - name: Set up conda
# uses: conda-incubator/setup-miniconda@v2
# with:
# auto-update-conda: true
# miniconda-version: "latest"
# channel-priority: strict
# channels: conda-forge
# show-channel-urls: true
# use-only-tar-bz2: true
# - name: Install Windows dependencies
# if: matrix.os == 'windows-2016' || matrix.os == 'windows-latest'
# run: choco install winflexbison3 --version 2.5.18.20190508
# - name: Install conda dependencies
# run: conda install conda-build conda-verify -y
# - name: Build & test
# env:
# NPROCS: 5
# run: conda build conda-recipe
# - name: Install
# # This doesn't seem to work on Windows in CI because everything appears
# # to build in a non-default environment and conda is broken for that,
# # see https://github.com/conda/conda/issues/7758
# # Note that conda build already does a test install in a fresh
# # environment, so this is a bit redundant anyway.
# if: matrix.os != 'windows-2016' && matrix.os != 'windows-latest'
# run: conda install openql --use-local