forked from OpenMined/TenSEAL
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add benchmarks action (OpenMined#286)
* add benchmarks action * add code security workflows
- Loading branch information
Showing
9 changed files
with
149 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: "CodeQL config" | ||
|
||
paths: | ||
- tenseal | ||
- tests | ||
paths-ignore: | ||
- third_party |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Benchmarks | ||
on: | ||
push: | ||
branches: [master] | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
benchmark: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
os: [macos-latest, ubuntu-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Prepare ENV | ||
run: | | ||
echo "CC=clang" >> $GITHUB_ENV | ||
echo "CXX=clang++" >> $GITHUB_ENV | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
- name: Install dependencies Ubuntu | ||
run: .github/workflows/scripts/install_req_ubuntu.sh | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
- name: Install dependencies MacOS | ||
run: .github/workflows/scripts/install_req_macos.sh | ||
if: ${{ matrix.os == 'macos-latest' }} | ||
- name: Install dependencies Windows | ||
run: .github/workflows/scripts/install_req_windows.bat | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
- name: Install dependencies Windows - msbuild | ||
uses: microsoft/[email protected] | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
- name: Build the library for Ubuntu/MacOS | ||
run: .github/workflows/scripts/build_nix.sh | ||
if: ${{ matrix.os != 'windows-latest' }} | ||
- name: Build the library for Windows | ||
run: .github/workflows/scripts/build_windows.bat | ||
if: ${{ matrix.os == 'windows-latest' }} | ||
- name: Run benchmarks | ||
run: | | ||
pytest tests/python/benchmarks/ --cov-fail-under 0 --benchmark-json pytest_benchmarks_output.json | ||
- name: Store benchmark result | ||
uses: rhysd/github-action-benchmark@v1 | ||
with: | ||
name: Python-Benchmarks | ||
tool: "pytest" | ||
output-file-path: pytest_benchmarks_output.json | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
auto-push: true | ||
benchmark-data-dir-path: "benchmarks/${{ runner.os }}" | ||
# Show alert with commit comment on detecting possible performance regression | ||
alert-threshold: "200%" | ||
comment-on-alert: true | ||
fail-on-alert: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: "CodeQL" | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
language: [ 'cpp', 'python' ] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
third_party/ | ||
build/ | ||
key: codeql-${{ runner.os }}-${{ matrix.language }}-tensealdeps-${{ hashFiles('third_party/SEAL/cmake/SEALConfig.cmake','.gitmodules') }} | ||
restore-keys: | | ||
codeql-${{ runner.os }}-${{ matrix.language }}-tensealdeps- | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{ matrix.language }} | ||
config-file: ./.github/codeql/codeql-config.yml | ||
|
||
- if: matrix.language == 'cpp' | ||
name: Build CPP | ||
run: | | ||
mkdir -p build && cd build | ||
cmake .. && make -j | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# This workflow integrates a collection of open source static analysis tools | ||
# with GitHub code scanning. For documentation, or to provide feedback, visit | ||
# https://github.com/github/ossar-action | ||
name: OSSAR | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
OSSAR-Scan: | ||
# OSSAR runs on windows-latest. | ||
# ubuntu-latest and macos-latest support coming soon | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# Run open source static analysis tools | ||
- name: Run OSSAR | ||
uses: github/ossar-action@v1 | ||
id: ossar | ||
|
||
# Upload results to the Security tab | ||
- name: Upload OSSAR results | ||
uses: github/codeql-action/upload-sarif@v1 | ||
with: | ||
sarif_file: ${{ steps.ossar.outputs.sarifFile }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,8 @@ | ||
[bumpversion] | ||
current_version = 0.3.2 | ||
commit = True | ||
tag = True | ||
files = tenseal/version.py | ||
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)((?P<release>[a-z]+)(?P<n>\d+))? | ||
serialize = | ||
{major}.{minor}.{patch}{release}{n} | ||
{major}.{minor}.{patch} | ||
|
||
[bumpversion:part:release] | ||
optional_value = gamma | ||
values = | ||
a | ||
b | ||
rc | ||
gamma | ||
|
||
[bumpversion:part:n] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.3.2" | ||
__version__ = "0.3.3" |