-
Notifications
You must be signed in to change notification settings - Fork 26
106 lines (100 loc) · 3.2 KB
/
onpullrequest-build-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
# Actions for pull requests only
name: zeth-ci-onpullrequest-build-ubuntu
on:
pull_request:
jobs:
# Job to build the grpc libraries. The grpc build directory is populated and
# cached so that all other jobs can mark this job as a prerequisite and just
# run `make install`.
#
# NOTE: the version number here (in `key` and in script arguments) must be
# kept in sync with the key used by the jobs.
onpr-build-grpc:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Cache grpc
uses: actions/cache@v2
with:
key: grpc-1.44.x-${{ runner.os }}
path: depends/grpc
- name: Build grpc
run: if ! [ -d depends/grpc ] ; then scripts/install-grpc /usr v1.44.x ; fi
# Extract the commits of submodules for use by cache steps
onpr-submodules:
runs-on: ubuntu-20.04
outputs:
commits: ${{ steps.get-commits.outputs.commits }}
steps:
- uses: actions/checkout@v2
- name: Get Submodule Commits
id: get-commits
run: |
git submodule sync
echo "::set-output name=commits::"`git submodule status depends/libsodium | grep -oe '[0-9a-fA-F]\+' | head -c 8`-`git submodule status depends/libsnark | grep -oe '[0-9a-fA-F]\+' | head -c 8`
# Run the prover testing python scripts
prover-tests-linux:
runs-on: ubuntu-20.04
needs: [onpr-build-grpc, onpr-submodules]
strategy:
matrix:
curve: [ BLS12_377, ALT_BN128 ]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Cache grpc
uses: actions/cache@v2
with:
key: grpc-1.44.x-${{ runner.os }}
path: depends/grpc
- name: Cache pip
uses: actions/cache@v2
with:
path: |
~/.cache/pip
~/Library/Caches/pip
key: prover-tests-pip-${{ hashFiles('**/setup.py') }}-${{ runner.os }}
- name: Install dependencies
run: |
INSTALL_ONLY=1 scripts/install-grpc /usr v1.44.x
sudo apt install -y ccache
- name: Execute
run: CI_CONFIG=Release CI_CURVE=${{ matrix.curve }} CI_PROVER_TESTS=1 scripts/ci build
# Run all unit tests and integration tests
integration-tests-linux:
runs-on: ubuntu-20.04
needs: [onpr-build-grpc, onpr-submodules]
strategy:
matrix:
curve: [ BLS12_377, ALT_BN128 ]
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Cache grpc
uses: actions/cache@v2
with:
key: grpc-1.44.x-${{ runner.os }}
path: depends/grpc
- name: Cache pip
uses: actions/cache@v2
with:
path: |
~/.cache/pip
~/Library/Caches/pip
key: integration-tests-pip-${{ hashFiles('**/setup.py') }}-${{ runner.os }}
- name: Install dependencies
run: |
INSTALL_ONLY=1 scripts/install-grpc /usr v1.44.x
sudo apt install -y ccache
- name: Execute
run: CI_CONFIG=Release CI_CURVE=${{ matrix.curve }} CI_FULL_TESTS=1 CI_INTEGRATION_TESTS=1 scripts/ci build