-
Notifications
You must be signed in to change notification settings - Fork 47
136 lines (132 loc) · 4.65 KB
/
test.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
name: Test
on:
push:
branches:
- develop
pull_request:
jobs:
cpp-linux-macos-windows:
name: 'C++ tests (Linux-MacOS-Windows/x64)'
strategy:
fail-fast: false
matrix:
# Building for {g++, clang++}/Linux, clang++/MacOS, and msvc/Windows
# both in Debug and Release
os: [ubuntu-latest, macos-latest, windows-latest]
compiler: [g++, clang++, msvc]
build_type: [Debug, Release]
exclude:
- os: ubuntu-latest
compiler: msvc
- os: macos-latest
compiler: g++
- os: macos-latest
compiler: msvc
- os: windows-latest
compiler: g++
- os: windows-latest
compiler: clang++
runs-on: ${{ matrix.os }}
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install conan
run: python -m pip install --upgrade pip conan
- name: Get latest CMake
uses: lukka/get-cmake@latest
- name: Checkout
uses: actions/checkout@v3
- name: Configure and build
run: |
conan profile detect
conan build . -s:h compiler.cppstd=23 -s:h openql/*:build_type=${{ matrix.build_type }} -o openql/*:build_tests=True -o openql/*:disable_unitary=True -b missing
- name: Test
working-directory: build/${{ matrix.build_type }}
run: ctest -C ${{ matrix.build_type }} --output-on-failure
cpp-arm64:
name: 'C++ tests (gcc/Linux/ARM64, clang/MacOS/ARM64)'
runs-on: [self-hosted, ARM64, "${{ matrix.os }}"]
strategy:
fail-fast: false
matrix:
os:
- Linux
- macOS
steps:
- if: matrix.os == 'Linux'
name: Install gcc and python (Linux)
run: |
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install gcc python3 python3-pip python3-venv
shell: bash
- if: matrix.os == 'macOS'
# We are having problems when using the m4 and zulu-opendjk Conan packages on an armv8 architecture
# m4 is required by flex/bison and zulu-openjdk provides the Java JRE required by the ANTLR generator
# So, for the time being, we are installing flex/bison and java manually for this platform
name: Install bison, flex, gcc, java and python (MacOS)
run: |
brew install bison flex gcc java python
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
echo "$(brew --prefix flex)/bin" >> $GITHUB_PATH
echo "$(brew --prefix java)/bin" >> $GITHUB_PATH
shell: bash
- name: Get latest CMake
uses: lukka/get-cmake@latest
- name: Checkout
uses: actions/checkout@v3
- name: Configure and build
env:
CXX: ${{ matrix.compiler }}
run: |
python3 -m venv venv
source venv/bin/activate
python3 -m pip install --upgrade pip conan
conan build . -s:h compiler.cppstd=23 -s:h openql/*:build_type=Release -o openql/*:build_tests=True -o openql/*:disable_unitary=True -b missing
- name: Test
working-directory: build/Release
run: ctest -C Release --output-on-failure
python:
name: Python
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install Python dependencies
run: python -m pip install --upgrade pip conan numpy pytest setuptools wheel qxelarator
- name: Install SWIG, and set build type (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install -y swig
echo "LIBQASM_BUILD_TYPE=Debug" >> $GITHUB_ENV
echo "OPENQL_DISABLE_UNITARY=true" >> $GITHUB_ENV
- name: Install flex/bison and SWIG, and set build type (MacOS)
if: matrix.os == 'macos-latest'
run: |
brew install swig
echo "LIBQASM_BUILD_TYPE=Debug" >> $GITHUB_ENV
echo "OPENQL_DISABLE_UNITARY=true" >> $GITHUB_ENV
- name: Set build type (Windows)
if: matrix.os == 'windows-latest'
shell: powershell
run: |
echo "LIBQASM_BUILD_TYPE=Release" >> $env:GITHUB_ENV
echo "OPENQL_BUILD_TYPE=Release" >> $env:GITHUB_ENV
echo "OPENQL_DISABLE_UNITARY=true" >> $env:GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
- name: Build
run: python -m pip install --verbose .
- name: Test
run: python -m pytest