Skip to content

Commit

Permalink
Merge pull request #340 from clearmatics/develop
Browse files Browse the repository at this point in the history
v0.6 - Obol
  • Loading branch information
AntoineRondelet committed Dec 21, 2020
2 parents 07ffdca + 9fe9d4d commit 9f3809c
Show file tree
Hide file tree
Showing 144 changed files with 6,781 additions and 3,566 deletions.
7 changes: 2 additions & 5 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
[*.yml]
indent_size = 2

4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

* @AntoineRondelet @dtebbs
66 changes: 66 additions & 0 deletions .github/workflows/code-scanning.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: zeth-ci-code-scanning

on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
- master
# TODO: Consider scheduling code scanning
#schedule:
# - cron: '0 1 * * 0'

env:
MACOS_BREW_PACKAGES: "pkg-config libomp"

jobs:

codeql-cpp-build-macos:
# For now, run the cpp analysis on macOS only for ease of grpc installation
runs-on: macos-latest
steps:
- name: Checkout repository and install submodules
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install Dependencies
run: brew install ${MACOS_BREW_PACKAGES}
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: cpp
- name: Custom build
run: CI_CONFIG=Release scripts/ci build
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

codeql-py-build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Custom dependencies installation
run: |
cd client
python -m venv env
source env/bin/activate
python -m pip install --upgrade pip
pip install --upgrade setuptools wheel
make setup
echo "CODEQL_PYTHON=$(which python)" >> $GITHUB_ENV
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: python
# Override default behavior for custom python deps installation
setup-python-dependencies: false
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1

53 changes: 53 additions & 0 deletions .github/workflows/dev-docker-apps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: dev-docker-build-zeth-apps

on:
push:
branches:
- develop
pull_request:
branches:
- master

env:
REPO_OWNER: "clearmatics"

jobs:

docker-build:
name: "Docker build"
runs-on: ubuntu-20.04
timeout-minutes: 360

strategy:
fail-fast: false
matrix:
app: ['mpc', 'client', 'prover']
max-parallel: 3

steps:
- name: "Checkout"
uses: actions/checkout@v2

- name: "Get vars from git"
id: git_vars
run: echo ::set-output name=COMMIT_HASH::$(git rev-parse --short HEAD)

- name: "Login to DockerHub"
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: "Docker build"
run: docker build -f ./Dockerfile-${{ matrix.app }} -t $REPO_OWNER/zeth-${{ matrix.app }}:git-${{ steps.git_vars.outputs.COMMIT_HASH }} .

- name: "Docker push"
run: docker push $REPO_OWNER/zeth-${{ matrix.app }}:git-${{ steps.git_vars.outputs.COMMIT_HASH }}

- name: "Docker Info"
run: |
docker inspect $REPO_OWNER/zeth-${{ matrix.app }}:git-${{ steps.git_vars.outputs.COMMIT_HASH }}
docker history $REPO_OWNER/zeth-${{ matrix.app }}:git-${{ steps.git_vars.outputs.COMMIT_HASH }} --no-trunc
docker version
docker info
uname -a
80 changes: 0 additions & 80 deletions .github/workflows/main.yml

This file was deleted.

19 changes: 19 additions & 0 deletions .github/workflows/onpullrequest-build-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Actions for pull requests only
name: zeth-ci-pull-request

on:
pull_request:

jobs:

build-linux-full:
runs-on: ubuntu-20.04
strategy:
matrix:
curve: [ BLS12_377, ALT_BN128 ]
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Execute
run: CI_EVENT_NAME=pull_request CI_USE_DOCKER=1 CI_CONFIG=Release CI_CURVE=${{ matrix.curve }} scripts/ci build
25 changes: 25 additions & 0 deletions .github/workflows/onpush-build-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Build actions for every push on macOS
name: zeth-ci-push-build-macos

on:
push:

env:
MACOS_BREW_PACKAGES: "pkg-config libomp"

jobs:

build-macos:
runs-on: macos-10.15
strategy:
matrix:
config: [ Debug, Release ]
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Install Dependencies
run: brew install ${MACOS_BREW_PACKAGES}
- name: Execute
run: CI_CONFIG=${{ matrix.config }} scripts/ci build

38 changes: 38 additions & 0 deletions .github/workflows/onpush-build-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Build actions for every push on ubuntu
name: zeth-ci-push-build-ubuntu

on:
push:

jobs:

build-linux:
runs-on: ubuntu-20.04
strategy:
matrix:
config: [ Debug, Release ]
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Execute
run: CI_CHECK_FORMAT=1 CI_USE_DOCKER=1 CI_CONFIG=${{ matrix.config }} scripts/ci build

build-linux-pghr13:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Execute
run: CI_USE_DOCKER=1 CI_CONFIG=Release CI_ZKSNARK=PGHR13 scripts/ci build

build-linux-bls12-377:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Execute
run: CI_USE_DOCKER=1 CI_CONFIG=Release CI_CURVE=BLS12_377 scripts/ci build

37 changes: 37 additions & 0 deletions .github/workflows/onpush-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Check actions (linters, analysis tools etc.)
name: zeth-ci-push-checks

on:
push:

jobs:

check-contracts:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- uses: actions/setup-node@v1
with:
node-version: 10
- name: Check Contracts
run: scripts/ci check_contracts

check-client:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Execute
run: scripts/ci check_client

check-cpp-linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v1
with:
submodules: recursive
- name: Execute
run: CI_CHECK_FORMAT=1 CI_USE_DOCKER=1 scripts/ci check_cpp
52 changes: 52 additions & 0 deletions .github/workflows/release-docker-apps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: release-docker-build-zeth-apps

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+ # Triggered by git tags like: v0.2.12

env:
REPO_OWNER: "clearmatics"

jobs:

docker-build:
name: "Docker build"
runs-on: ubuntu-20.04
timeout-minutes: 360

strategy:
matrix:
app: ['mpc', 'client', 'prover']
max-parallel: 3

steps:
- name: "Checkout"
uses: actions/checkout@v2

- name: "Get vars from git"
id: git_vars
run: echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}

- name: "Login to DockerHub"
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: "Docker build"
run: docker build -f ./Dockerfile-${{ matrix.app }} -t $REPO_OWNER/zeth-${{ matrix.app }}:${{ steps.git_vars.outputs.TAG }} .

- name: "Docker push"
run: |
docker push $REPO_OWNER/zeth-${{ matrix.app }}:${{ steps.git_vars.outputs.TAG }}
docker tag $REPO_OWNER/zeth-${{ matrix.app }}:${{ steps.git_vars.outputs.TAG }} $REPO_OWNER/zeth-${{ matrix.app }}:latest
docker push $REPO_OWNER/zeth-${{ matrix.app }}:latest
- name: "Docker Info"
run: |
docker inspect $REPO_OWNER/zeth-${{ matrix.app }}:${{ steps.git_vars.outputs.TAG }}
docker history $REPO_OWNER/zeth-${{ matrix.app }}:${{ steps.git_vars.outputs.TAG }} --no-trunc
docker version
docker info
uname -a
Loading

0 comments on commit 9f3809c

Please sign in to comment.