-
Notifications
You must be signed in to change notification settings - Fork 14
98 lines (89 loc) · 2.85 KB
/
ci-linux-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
name: "Linux CI"
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- created
jobs:
build:
runs-on: ubuntu-22.04
name: "Linux 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}}
- name: "Installing dependencies"
run: |
sudo apt-get update -y
sudo apt-get install -y
sudo apt-get install -y --no-install-recommends curl cmake pkg-config findutils wget
sudo apt-get remove -y clang-13 llvm-13 clang-format-13 clang-tidy-13 clang-12 llvm-12 clang-format-12 clang-tidy-12
sudo apt install -y --no-install-recommends clang-14 llvm-14 clang-format-14 clang-tidy-14
sudo apt-get install -y nodejs npm
sudo apt install -y python3 python3-pip
sudo ln -s /usr/lib/llvm-14/bin/opt /usr/bin/opt
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 0
dotnet tool install --global Microsoft.Quantum.IQSharp --version 0.24.201332
git submodule update --init --recursive
pip install -r requirements.txt
npm install -g [email protected]
env:
DEBIAN_FRONTEND: noninteractive
PYTHONUNBUFFERED: 1
PYTHON_BIN_PATH: /usr/bin/python3
CC: clang-14
CXX: clang++-14
- name: "Running unit tests"
run: |
mkdir Debug
cd Debug
cmake ..
make
env:
DEBIAN_FRONTEND: noninteractive
PYTHONUNBUFFERED: 1
PYTHON_BIN_PATH: /usr/bin/python3
CC: clang-14
CXX: clang++-14
- 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
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
pip install pytest
pip install -r requirements.txt
cd qir/qir-tests/
pytest
env:
DEBIAN_FRONTEND: noninteractive
PYTHONUNBUFFERED: 1
PYTHON_BIN_PATH: /usr/bin/python3
CC: clang-14
CXX: clang++-14
- name: "Running examples"
run: |
make test-examples
env:
DEBIAN_FRONTEND: noninteractive
PYTHONUNBUFFERED: 1
PYTHON_BIN_PATH: /usr/bin/python3
CC: clang-14
CXX: clang++-14