-
Notifications
You must be signed in to change notification settings - Fork 6
182 lines (150 loc) · 4.58 KB
/
ci_ubuntu.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
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
171
172
173
174
175
176
177
178
179
180
181
182
name: Ubuntu CI
on:
pull_request:
push:
jobs:
gcc8-build:
name: GCC8 build
strategy:
matrix:
python-version: ["3.7.5"]
runs-on: "docker-runner"
env:
CXX_COMPILER: "/usr/lib/ccache/g++"
C_COMPILER: "/usr/lib/ccache/gcc"
PYTHON: ${{ matrix.python-version }}
COVERAGE: "ON"
CACHE_NAME: ccache-qulacs-build
steps:
- uses: actions/checkout@v2
- name: Setup cmake
uses: lukka/get-cmake@latest
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install ccache
run: apt install ccache
- name: Setup cache
uses: actions/cache@v2
with:
path: ~/.ccache
key: ${{ runner.os }}-${{ env.CACHE_NAME }}
- name: Install Python dependencies
run: pip install -U --only-binary=numpy,scipy numpy scipy openfermion
- name: Install qulacs for Ubuntu
run: ./script/build_gcc.sh
- name: Install qulacs Python module
run: python setup.py install
- name: Test in Ubuntu
run: |
cd ./build
make test
make pythontest
- name: Show cache stats
run: ccache -s
nvcc-gcc8-GPUbuild:
name: nvcc + gcc8 build
strategy:
matrix:
python-version: ["3.7.5"]
runs-on: ["ubuntu-self-hosted"]
env:
CXX_COMPILER: "g++-8"
C_COMPILER: "gcc-8"
PYTHON: ${{ matrix.python-version }}
COVERAGE: "ON"
steps:
- uses: actions/checkout@v2
- name: Setup cmake
uses: lukka/get-cmake@latest
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Install Python dependencies
run: pip install -U --only-binary=numpy,scipy numpy scipy openfermion
- name: Install qulacs for Ubuntu
run: ./script/build_gcc_with_gpu.sh
- name: Install qulacs Python module
run: python setup.py install
- name: Test in Ubuntu
run: |
cd ./build
make test -j
make pythontest -j
source-dist:
name: Source dist
needs: gcc8-build
strategy:
matrix:
python-version: ["3.7.5"]
runs-on: "ubuntu-self-hosted"
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_QULACS }}
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Run sdist
run: python setup.py sdist
- name: Uplead the source if the Git tag is set
run: |
python -m pip install twine
python -m twine upload dist/*
# This condition is refered for:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions
if: ${{ contains(github.ref, '/tags/') }}
source-dist-gpu:
name: Source dist (Qulacs-GPU)
needs: gcc8-build
strategy:
matrix:
python-version: ["3.7.5"]
runs-on: "ubuntu-self-hosted"
env:
TWINE_USERNAME: "__token__"
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD_QULACS_GPU }}
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- name: Switch setup.py to GPU enabled version
run: cp setup_gpu.py setup.py
- name: Run sdist
run: python setup.py sdist
- name: Uplead the source if the Git tag is set
run: |
python -m pip install twine
python -m twine upload dist/*
# This condition is refered for:
# https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions
if: ${{ contains(github.ref, '/tags/') }}
format:
name: Format with clang-format
strategy:
matrix:
os: ["ubuntu-self-hosted"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup cmake
uses: lukka/get-cmake@latest
- name: Install qulacs for Ubuntu
run: ./script/build_gcc.sh
- name: Run clang-format
run: cmake --build build --target format
- name: Compare diff
run: |
diff=$(git diff)
echo $diff
test $(echo -n $diff | wc -l) -eq 0