Skip to content

Commit

Permalink
draft: vcdi proposall format integration
Browse files Browse the repository at this point in the history
Signed-off-by: supersonicwisd1 <[email protected]>
  • Loading branch information
supersonicwisd1 committed Mar 5, 2024
0 parents commit 1535702
Show file tree
Hide file tree
Showing 2,014 changed files with 307,797 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
comment:
layout: "header, diff"
behavior: default
require_changes: no
3 changes: 3 additions & 0 deletions .commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
};
21 changes: 21 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.134.0/containers/python-3/.devcontainer/base.Dockerfile
ARG VARIANT="3.9"
FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

ARG POETRY_VERSION="1.4"
ENV POETRY_HOME="/opt/poetry" \
POETRY_VERSION=${POETRY_VERSION}

RUN curl -sSL https://install.python-poetry.org | python3 - \
&& update-alternatives --install /usr/local/bin/poetry poetry /opt/poetry/bin/poetry 900 \
# Enable tab completion for bash
&& poetry completions bash >> /home/vscode/.bash_completion \
# Enable tab completion for Zsh
&& mkdir -p /home/vscode/.zfunc/ \
&& poetry completions zsh > /home/vscode/.zfunc/_poetry \
&& echo "fpath+=~/.zfunc\nautoload -Uz compinit && compinit" >> /home/vscode/.zshrc

COPY pyproject.toml poetry.lock ./
RUN poetry config virtualenvs.create false \
&& poetry install --no-root --no-interaction --all-extras \
&& rm -rf /root/.cache/pypoetry
66 changes: 66 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "aries_cloudagent",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
"VARIANT": "3.9-bullseye",
"POETRY_VERSION": "1.7.1"
}
},
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-python.black-formatter",
"charliermarsh.ruff"
],
"settings": {
"python.testing.pytestArgs": [
"aries_cloudagent",
"--no-cov"
],
"python.testing.autoTestDiscoverOnSaveEnabled": true,
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
"python.testing.pytestPath": "pytest",
"editor.formatOnSave": false, // enable per language
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
},
"editor.defaultFormatter": "ms-python.black-formatter",
"ruff.organizeImports": false
},
"black-formatter.importStrategy": "useBundled",
"black-formatter.showNotifications": "always",
"ruff.codeAction.fixViolation": {
"enable": true
},
"ruff.fixAll": true,
"ruff.format.args": ["--config=./pyproject.toml"],
"ruff.lint.args": ["--config=./pyproject.toml"]
}
}
},

"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",

"remoteEnv": {
"RUST_LOG":"aries-askar::log::target=error"
//"PATH": "${containerEnv:PATH}:${workspaceRoot}/.venv/bin"
},

"mounts": [],
"postCreateCommand": "bash ./.devcontainer/post-install.sh"

}
37 changes: 37 additions & 0 deletions .devcontainer/post-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
set -ex

# Convenience workspace directory for later use
WORKSPACE_DIR=$(pwd)

# install all ACA-Py requirements
python -m pip install --upgrade pip
pip3 install -r demo/requirements.txt -r demo/requirements.behave.txt

# install black for formatting
pip3 install black

# install a version of aries-cloudagent so the pytests can pick up a version
pip3 install aries-cloudagent

# hack/workaround to allow `pytest .` and `poetry run pytest` work.
# need to not run ruff...

cat > .pytest.ini <<EOF
# this is created for the devcontainer so pytests are properly discoverable.
# remove this file for normal operations outside of the devcontainer.
# basically we cannot have ruff (--ruff) in the pytest configuration as it breaks the Testing View.
[pytest]
testpaths = "aries_cloudagent"
addopts = --quiet
markers = [
"anoncreds: Tests specifically relating to AnonCreds support",
"askar: Tests specifically relating to Aries-Askar support",
"indy: Tests specifically relating to Hyperledger Indy SDK support",
"indy_credx: Tests specifically relating to Indy-Credx support",
"indy_vdr: Tests specifically relating to Indy-VDR support",
"ursa_bbs_signatures: Tests specificaly relating to BBS Signatures support",
"postgres: Tests relating to the postgres storage plugin for Indy"]
junit_family = "xunit1"
asyncio_mode = auto
EOF
18 changes: 18 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
.git
.pytest_cache
__pycache__
*.egg-info
build
docs
dist
test-reports
.python-version
docker
env
.venv
.devcontainer
.vscode
.vscode-sample
.pytest_cache
.ruff_cache
.pytest.ini
11 changes: 11 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Declare files that will always have LF line endings on checkout.
*.sh text eol=lf
*.md text eol=lf
*.json text eol=lf
*.conf text eol=lf
**/bin/* text eol=lf
scripts/* text eol=lf
demo/run_demo text eol=lf
20 changes: 20 additions & 0 deletions .github/actions/run-indy-tails-server/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Run Tails Server"
description: "Build and Run Indy Tails Server"
author: "[email protected]"
runs:
using: "composite"
steps:
- name: checkout-indy-tails-server
run: git clone https://github.com/bcgov/indy-tails-server.git
shell: bash
- name: build-indy-tails-server
run: ./manage build
shell: bash
working-directory: indy-tails-server/docker
- name: run-indy-tails-server
run: ./manage start
shell: bash
working-directory: indy-tails-server/docker
branding:
icon: "scissors"
color: "purple"
33 changes: 33 additions & 0 deletions .github/actions/run-integration-tests/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Run Aca-Py Integration Tests"
description: "Run integration tests for Aca-Py"
author: "[email protected]"
inputs:
TEST_SCOPE:
description: "Set of flags that defines the test scope"
required: false
default: "-t @GHA"
IN_LEDGER_URL:
description: "URL to the von network ledger browser"
required: false
default: "http://test.bcovrin.vonx.io"
IN_PUBLIC_TAILS_URL:
description: "URL to the tails server"
required: false
default: "https://tails-test.vonx.io"
runs:
using: "composite"
steps:
- name: run-integration-tests-acapy
# to run with external ledger and tails server run as follows (and remove the ledger and tails actions from the workflow):
# run: LEDGER_URL=http://test.bcovrin.vonx.io PUBLIC_TAILS_URL=https://tails.vonx.io ./run_bdd ${{ inputs.TEST_SCOPE }}
run: ./run_bdd ${{ inputs.TEST_SCOPE }}
shell: bash
env:
LEDGER_URL: ${{ inputs.IN_LEDGER_URL }}
PUBLIC_TAILS_URL: ${{ inputs.IN_PUBLIC_TAILS_URL }}
LOG_LEVEL: warning
NO_TTY: "1"
working-directory: acapy/demo
branding:
icon: "mic"
color: "purple"
20 changes: 20 additions & 0 deletions .github/actions/run-von-network/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: "Run von-network"
description: "Build and run Indy network using von-network"
author: "[email protected]"
runs:
using: "composite"
steps:
- name: checkout-von-network
run: git clone https://github.com/bcgov/von-network.git
shell: bash
- name: build-von-network
run: ./manage build
shell: bash
working-directory: von-network
- name: run-von-network
run: ./manage start
shell: bash
working-directory: von-network
branding:
icon: "cloud-lightning"
color: "blue"
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# For details on how this file works refer to:
# - https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
# Maintain dependencies for GitHub Actions
# - Check for updates once a week
# - Group all updates into a single PR
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
groups:
all-actions:
patterns: [ "*" ]
20 changes: 20 additions & 0 deletions .github/workflows/blackformat.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Black Code Formatter Check

"on":
pull_request:
branches:
- main

jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Black Code Formatter Check
# The version of black should be adjusted at the same time dev
# dependencies are updated.
uses: psf/[email protected]
29 changes: 29 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "Code scanning - action"

"on":
push:
pull_request:
schedule:
- cron: "0 19 * * 0"

jobs:
CodeQL-Build:
# CodeQL runs on ubuntu-latest and windows-latest
runs-on: ubuntu-latest
if: (github.event_name == 'pull_request' && github.repository == 'hyperledger/aries-cloudagent-python') || (github.event_name != 'pull_request')

permissions:
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: python

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
34 changes: 34 additions & 0 deletions .github/workflows/integrationtests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: acapy-integration-tests

on:
workflow_dispatch:
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

defaults:
run:
shell: bash

jobs:
test:
runs-on: ubuntu-latest
if: (github.event_name == 'pull_request' && github.repository == 'hyperledger/aries-cloudagent-python') || (github.event_name != 'pull_request')
steps:
- name: checkout-acapy
uses: actions/checkout@v4
with:
path: acapy
#- name: run-von-network
# uses: ./acapy/.github/actions/run-von-network
#- name: run-indy-tails-server
# uses: ./acapy/.github/actions/run-indy-tails-server
- name: run-integration-tests
uses: ./acapy/.github/actions/run-integration-tests
# to run with a specific set of tests include the following parameter:
# with:
# TEST_SCOPE: "-t @T001-RFC0037"
49 changes: 49 additions & 0 deletions .github/workflows/nigthly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Nightly Publish

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
tests:
if: github.repository == 'hyperledger/aries-cloudagent-python' || github.event_name == 'workflow_dispatch'
name: Tests
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
python-version: ["3.9", "3.10"]
uses: ./.github/workflows/tests.yml
with:
python-version: ${{ matrix.python-version }}
os: ${{ matrix.os }}

setup_and_check_pub:
name: Setup Publish
runs-on: ubuntu-latest
outputs:
commits_today: ${{ steps.commits.outputs.commits_today }}
date: ${{ steps.date.outputs.date }}
steps:
- uses: actions/checkout@v4
- name: print latest_commit
run: echo ${{ github.sha }}
- name: Get new commits
id: commits
run: echo "commits_today=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_OUTPUT
- name: Get Date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT

publish:
name: Publish
needs: [tests, setup_and_check_pub]
if: needs.setup_and_check_pub.outputs.commits_today > 0
uses: ./.github/workflows/publish.yml
strategy:
matrix:
tag: ["nightly-${{needs.setup_and_check_pub.outputs.date}}", nightly]
with:
tag: ${{ matrix.tag }}
platforms: "linux/amd64"
Loading

0 comments on commit 1535702

Please sign in to comment.