feat: initial commit

This commit is contained in:
2021-11-21 13:58:52 +00:00
commit fb7fec7ea6
53 changed files with 4920 additions and 0 deletions

62
.github/workflows/analysis.yml vendored Normal file
View File

@@ -0,0 +1,62 @@
name: analysis
on:
push:
branches:
- main
jobs:
analysis:
runs-on: ubuntu-latest
steps:
# Checkout repo & install Python
- name: Check out repository
uses: actions/checkout@v2
with:
# disable shallow clones for better sonarcloud accuracy
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
# Install & configure Poetry
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
# Load cached venv
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
# Install dependencies if no cache
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
# Install package if needed
- name: Install package
run: poetry install --no-interaction
# Run tests
- name: Run tests
run: |
source .venv/bin/activate
pytest -v --cov --junitxml=pytest.xml --suppress-tests-failed-exit-code
coverage xml -i
sed -i 's/\/home\/runner\/work\/tembo-core\/tembo-core\///g' coverage.xml
sed -i 's/\/home\/runner\/work\/tembo-core\/tembo-core\///g' pytest.xml
# Build docs
- name: Build docs
run: |
source .venv/bin/activate
coverage html
mkdocs gh-deploy
# Upload to sonarcloud
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}