-
Notifications
You must be signed in to change notification settings - Fork 14
134 lines (116 loc) · 3.68 KB
/
ci-mac-on-main-pr.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
name: "macOS CI"
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- created
jobs:
build:
runs-on: macos-12
name: "Mac CI"
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- uses: actions/setup-dotnet@v2
with:
dotnet-version: "6.0.x"
- name: "Installing dependencies"
run: |
rm '/usr/local/bin/2to3'
brew install llvm@14
brew install cmake
brew install [email protected]
brew unlink [email protected]
brew install node@16
brew link [email protected]
echo "/Users/runner/Library/Python/3.9/bin" >> $GITHUB_PATH
echo "/usr/local/opt/llvm@14/bin" >> $GITHUB_PATH
echo "/usr/local/opt/node@16/bin" >> $GITHUB_PATH
echo "/Users/runner/Library/Python/3.9/lib/python/bin" >> $GITHUB_PATH
echo "/usr/local/bin/$HOME/bin" >> $GITHUB_PATH
git submodule update --init --recursive
python3 -m pip install --upgrade pip
pip3 install --user -r requirements.txt
pip3 install virtualenv
python3 -c "import autopep8;print(autopep8.__file__)"
dotnet tool install --global Microsoft.Quantum.IQSharp --version 0.24.201332
npm install -g [email protected]
exec -l $SHELL
- name: "Building"
run: |
mkdir Debug
cd Debug
cmake ..
make
env:
LDFLAGS: "-L/usr/local/opt/llvm@14/lib -Wl,-rpath,/usr/local/opt/llvm@14/lib"
CPPFLAGS: "-I/usr/local/opt/llvm@14/include"
CC: clang
CXX: clang++
- name: "Running Q# tests"
run: |
git clone https://github.com/microsoft/Quantum.git
export QAT_BINARY=${PWD}/Debug/qir/qat/Apps/qat
export QSHARP_SAMPLES=${PWD}/Quantum/samples
pushd qir/qsharp-tests/
pip3 install --user pytest
python3 -m pytest
- name: "Running QIR tests"
run: |
mkdir -p Debug
pushd Debug
cmake ..
make -j qat
popd
export QAT_BINARY=${PWD}/Debug/qir/qat/Apps/qat
pip3 install pytest
pip3 install -r requirements.txt
cd qir/qir-tests/
python3 -m pytest
env:
DEBIAN_FRONTEND: noninteractive
PYTHONUNBUFFERED: 1
PYTHON_BIN_PATH: /usr/bin/python3
CC: clang
CXX: clang++
- name: "Running examples"
run: |
make test-examples
env:
LDFLAGS: "-L/usr/local/opt/llvm@14/lib -Wl,-rpath,/usr/local/opt/llvm@14/lib"
CPPFLAGS: "-I/usr/local/opt/llvm@14/include"
CC: clang
CXX: clang++
- name: "Running Qiskit tests"
run: |
virtualenv develop_env
source develop_env/bin/activate
mkdir -p Debug
pushd Debug
cmake ..
make -j qat
popd
git clone https://github.com/microsoft/qiskit-qir.git
pushd qiskit-qir
pip3 install -e .
popd
echo "Testing installation"
python -c "from qiskit_qir import to_qir_module"
echo "Done"
export PYTHONPATH=$PWD/qiskit-qir/tests:$PYTHONPATH
export QAT_BINARY=${PWD}/Debug/qir/qat/Apps/qat
pushd qir/qiskit-tests/
pip3 install pytest
python3 -m pytest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CC: clang
CXX: clang++