-
Notifications
You must be signed in to change notification settings - Fork 6
176 lines (174 loc) · 5.37 KB
/
ci.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
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
release:
types: [published]
jobs:
build_windows_gui:
needs: [build]
runs-on: windows-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: wheels-3.9
path: gui
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- uses: conda-incubator/setup-miniconda@v2
with:
auto-activate-base: true
activate-environment: ""
- name: Build Electron app
run: |
cd gui
dir
conda create --name ETA python=3.11
conda activate ETA
conda install conda-forge::conda-pack
pip install --find-links=.\ etabackend
conda pack -n ETA -o bundle_eta.tar.gz
mkdir eta_env
tar -xzf bundle_eta.tar.gz -C eta_env
yarn
yarn dist
cd ..
ls .\gui\dist\
echo 7z a ETA_Install-win64.zip .\gui\dist\*.exe
mkdir artifact
move .\gui\dist\*.exe .\artifact
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: ETA_Install-win64
path: artifact
# compile-m1:
# runs-on: macos-latest
# strategy:
# matrix:
# python-version: [3.9]
# steps:
# - uses: actions/checkout@v2
# - name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
# - name: Install clang-12
# run: |
# brew install llvm@12
# - name: Install dependencies and build
# run: |
# pip3 install virtualenv
# virtualenv venv
# source venv/bin/activate
# ls
# export PATH="/usr/local/opt/llvm@12/bin:$PATH"
# export LDFLAGS="-L/opt/homebrew/opt/llvm@12/lib"
# export CPPFLAGS="-I/opt/homebrew/opt/llvm@12/include"
# export CXXFLAGS="-I/opt/homebrew/opt/llvm@12/include"
# clang etabackend/cpp/PARSE_TimeTagFileHeader.cpp -D __linux__ -S -emit-llvm
# clang etabackend/cpp/PARSE_TimeTags.cpp -D __linux__ -S -emit-llvm
# clang etabackend/cpp/INFRA_vchn.cpp -D __linux__ -S -emit-llvm
# mv *.ll etabackend/ll/m1
# pip install -e ./
# pytest
# - name: Upload artifact
# uses: actions/upload-artifact@v1
# with:
# name: ll-m1
# path: etabackend/ll/m1
build:
#needs: [compile-m1]
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and build
run: |
sudo apt-get update
sudo apt-get install -y clang-11
sudo apt-get install -y llvm-11
pip3 install virtualenv
virtualenv venv
source venv/bin/activate
ls
clang-11 etabackend/cpp/PARSE_TimeTagFileHeader.cpp -S -emit-llvm
clang-11 etabackend/cpp/PARSE_TimeTags.cpp -S -emit-llvm
clang-11 etabackend/cpp/INFRA_vchn.cpp -S -emit-llvm
mv *.ll etabackend/ll/posix
python3 setup.py bdist_wheel
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: wheels-${{ matrix.python-version }}
path: dist
publish:
needs: [build, test]
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest
env:
PYPI_PASSWORD: ${{secrets.PYPI_PASSWORD}}
TWINE_PASSWORD: ${{secrets.PYPI_PASSWORD}}
TWINE_USERNAME: ${{secrets.PYPI_USERNAME}}
PYPI_USERNAME: ${{secrets.PYPI_USERNAME}}
strategy:
matrix:
python-version: [3.9]
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip3 install twine
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: wheels-3.9
path: dist
- name: Twine upload
run: |
ls
twine upload dist/*.whl --skip-existing
test:
needs: [build]
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
python-version: ["3.9", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Download artifact
uses: actions/download-artifact@v1
with:
name: wheels-3.9
path: dist
- name: Test with pytest
run: |
python -m pip install pytest
mv ./dist/*.whl ./etabackend-9.9.9-py3-none-any.whl
python -m pip install ./etabackend-9.9.9-py3-none-any.whl
pytest