Skip to content

Commit

Permalink
Initial (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
DWSR committed Nov 3, 2020
1 parent 88d7568 commit e321877
Show file tree
Hide file tree
Showing 24 changed files with 1,753 additions and 0 deletions.
128 changes: 128 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: CI

on:
- push
- pull_request

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Setup Poetry
uses: abatilo/[email protected]
with:
poetry-version: '1.1.3'
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'
- name: Restore dependencies
uses: actions/cache@v2
with:
path: |
vendor
.venv
key: "build-v1-${{ runner.os }}-${{ hashFiles('poetry.lock', 'Gemfile.lock')}}"
restore-keys: |
build-v1-${{ runner.os }}-${{ hashFiles('poetry.lock', 'Gemfile.lock')}}
build-v1-${{ runner.os }}-
build-v1-
- name: Install dependencies
run: >
bundle install --frozen --jobs 2 --path vendor/bundle --clean &&
poetry config virtualenvs.in-project true &&
poetry install --remove-untracked
- name: Run pre-commit
run: >
poetry run pre-commit install --install-hooks &&
poetry run pre-commit run --all-files
kitchen-docker:
name: "Run Test Kitchen on Linux"
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Setup Poetry
uses: abatilo/[email protected]
with:
poetry-version: '1.1.3'
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'
- name: Restore dependencies
uses: actions/cache@v2
with:
path: |
vendor
.venv
key: "build-v1-${{ runner.os }}-${{ hashFiles('poetry.lock', 'Gemfile.lock')}}"
restore-keys: |
build-v1-${{ runner.os }}-${{ hashFiles('poetry.lock', 'Gemfile.lock')}}
build-v1-${{ runner.os }}-
build-v1-
- name: Install dependencies
run: >
bundle install --frozen --jobs 2 --path vendor/bundle --clean &&
poetry config virtualenvs.in-project true &&
poetry install --remove-untracked
# Can't run in parallel because of the hax required to get kitchen-ansible
# working with single roles
- name: Run Test Kitchen
run: >
poetry run bundle exec kitchen test default
kitchen-macos:
name: "Run Test Kitchen on MacOS"
needs: lint
runs-on:
- macos-10.15
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Setup Poetry
uses: abatilo/[email protected]
with:
poetry-version: '1.1.3'
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: '2.7'
- name: Restore dependencies
uses: actions/cache@v2
with:
path: |
vendor
.venv
key: "build-v1-${{ runner.os }}-${{ hashFiles('poetry.lock', 'Gemfile.lock')}}"
restore-keys: |
build-v1-${{ runner.os }}-${{ hashFiles('poetry.lock', 'Gemfile.lock')}}
build-v1-${{ runner.os }}-
build-v1-
- name: Install dependencies
run: >
bundle install --frozen --jobs 2 --path vendor/bundle --clean &&
poetry config virtualenvs.in-project true &&
poetry install --remove-untracked &&
brew install docker
- name: Run Test Kitchen
shell: /bin/zsh {0}
run: >
poetry run bundle exec kitchen test zsh
208 changes: 208 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@

# Created by https://www.toptal.com/developers/gitignore/api/ruby,python
# Edit at https://www.toptal.com/developers/gitignore?templates=ruby,python

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
pytestdebug.log

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
doc/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
pythonenv*

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# profiling data
.prof

### Ruby ###
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/

# Used by dotenv library to load environment variables.
# .env

# Ignore Byebug command history file.
.byebug_history

## Specific to RubyMotion:
.dat*
.repl_history
*.bridgesupport
build-iPhoneOS/
build-iPhoneSimulator/

## Specific to RubyMotion (use of CocoaPods):
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
# vendor/Pods/

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalization:
/.bundle/
/vendor/bundle
/lib/bundler/man/

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
# .ruby-version
# .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

# Used by RuboCop. Remote config files pulled in from inherit_from directive.
# .rubocop-https?--*

### Ruby Patch ###
# Used by RuboCop. Remote config files pulled in from inherit_from directive.
# .rubocop-https?--*

# End of https://www.toptal.com/developers/gitignore/api/ruby,python

.kitchen/
.kitchen.local.yml
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: check-added-large-files
- id: check-executables-have-shebangs
- id: pretty-format-json
args:
- --indent=2
- --autofix
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: '1.11.0'
hooks:
- id: shellcheck
- id: shfmt
# - repo: https://github.com/ansible/ansible-lint
# rev: v4.2.0
# hooks:
# - id: ansible-lint
- repo: https://github.com/adrienverge/yamllint
rev: v1.19.0
hooks:
- id: yamllint
args: [-s]
- repo: https://gitlab.com/smop/pre-commit-hooks
rev: v1.0.0
hooks:
- id: check-poetry
2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ruby 2.7.2
python 3.9.0
Loading

0 comments on commit e321877

Please sign in to comment.