-
Notifications
You must be signed in to change notification settings - Fork 45
210 lines (173 loc) · 6.7 KB
/
Copy pathmain.yml
File metadata and controls
210 lines (173 loc) · 6.7 KB
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: build
# Run this workflow every time a new commit pushed to your repository
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build, install, and test MC2 Client
# Define the OS to run on
runs-on: ubuntu-18.04
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8']
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
path: main
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade Pip
run: python -m pip install --upgrade pip setuptools wheel
- name: Install apt package dependencies
run: |
# Install OpenEnclave 0.17.1
echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu bionic main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-7 main" | sudo tee /etc/apt/sources.list.d/llvm-toolchain-bionic-7.list
wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main" | sudo tee /etc/apt/sources.list.d/msprod.list
wget -qO - https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt update
sudo apt -y install clang-8 libssl-dev gdb libsgx-enclave-common libsgx-quote-ex libprotobuf10 libsgx-dcap-ql libsgx-dcap-ql-dev az-dcap-client open-enclave=0.17.1
# CMake
wget https://github.com/Kitware/CMake/releases/download/v3.15.6/cmake-3.15.6-Linux-x86_64.sh
# Mbed TLS
sudo apt-get install -y libmbedtls-dev
- name: Build C++
run: |
# Build C++ source
cd main
cd src
mkdir build
cd build
cmake ..
make -j4
cd ../..
- name: Install Python dependencies
run: |
# Python packages
# pip install setuptools wheel pytest
cd main
pip install -r requirements.txt
- name: Install mc2client Python package
run: |
# Install the Python package
cd main/python-package
python setup.py install
- name: Checkout sequencefile Python package
uses: actions/checkout@master
with:
path: sequencefile
repository: opaque-systems/sequencefile
- name: Install sequencefile Python package
run: cd sequencefile; python setup.py install
shell: bash
- name: Run tests
run: cd main/python-package/tests; pytest
shell: bash
lint:
# Name the Job
name: Lint code base
# Set the type of machine to run on
runs-on: ubuntu-18.04
steps:
# Checks out a copy of your repository on the ubuntu-18.04 machine
- name: Checkout code
uses: actions/checkout@v2
# Runs the Super-Linter action
- name: Run Super-Linter
uses: github/super-linter@v4.5.1
env:
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER_REGEX_EXCLUDE: .*src/include/(csv.hpp|json.hpp|base64.h)
LINTER_RULES_PATH: /
VALIDATE_CLANG_FORMAT: true
VALIDATE_PYTHON_BLACK: true
PYTHON_BLACK_CONFIG_FILE: pyproject.toml
VALIDATE_PYTHON_FLAKE8: true
PYTHON_FLAKE8_CONFIG_FILE: .flake8
# Build documentation
docs:
name: Build and check documentation
# Define the OS to run on
runs-on: ubuntu-18.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: true
path: main
- name: Set up Python 3.6
uses: actions/setup-python@v2
with:
python-version: 3.6
- name: Upgrade Pip
run: python -m pip install --upgrade pip setuptools wheel
- name: Install apt package dependencies
run: |
# Install OpenEnclave 0.17.1
echo 'deb [arch=amd64] https://download.01.org/intel-sgx/sgx_repo/ubuntu bionic main' | sudo tee /etc/apt/sources.list.d/intel-sgx.list
wget -qO - https://download.01.org/intel-sgx/sgx_repo/ubuntu/intel-sgx-deb.key | sudo apt-key add -
echo "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-7 main" | sudo tee /etc/apt/sources.list.d/llvm-toolchain-bionic-7.list
wget -qO - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
echo "deb [arch=amd64] https://packages.microsoft.com/ubuntu/18.04/prod bionic main" | sudo tee /etc/apt/sources.list.d/msprod.list
wget -qO - https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
sudo apt update
sudo apt -y install clang-8 libssl-dev gdb libsgx-enclave-common libsgx-quote-ex libprotobuf10 libsgx-dcap-ql libsgx-dcap-ql-dev az-dcap-client open-enclave=0.17.1 enchant
# CMake
wget https://github.com/Kitware/CMake/releases/download/v3.15.6/cmake-3.15.6-Linux-x86_64.sh
# Mbed TLS
sudo apt-get install -y libmbedtls-dev
- name: Build C++
run: |
# Build C++ source
cd main
cd src
mkdir build
cd build
cmake ..
make -j4
cd ../..
- name: Install Python dependencies
run: |
cd main
pip install -r requirements.txt
pip install -r client-docs/requirements.txt
- name: Install mc2client Python package
run: |
# Install the Python package
cd main/python-package
python setup.py install
- name: Checkout sequencefile Python package
uses: actions/checkout@master
with:
path: sequencefile
repository: opaque-systems/sequencefile
- name: Install sequencefile Python package
run: cd sequencefile; python setup.py install
shell: bash
- name: Little hack to make this repo's docs build properly
run: |
cd main/client-docs
mkdir -p _build/tmp
cp ../mc2.py _build/tmp
- name: Build docs
run: |
cd main/client-docs
make html
- name: Run spellcheck
run : |
cd main/client-docs
sphinx-build -b spelling . _build