generated from trfore/ansible-role
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update dev workflow, consolidate task files, add molecule tests (#15)
- Loading branch information
Showing
29 changed files
with
512 additions
and
156 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,9 @@ | ||
profile: production | ||
exclude_paths: | ||
- .github/workflows/ | ||
- .tox/ | ||
- .venv/ | ||
- changelogs/changelog.yaml | ||
warn_list: | ||
- command-instead-of-shell | ||
- yaml[line-length] |
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,12 +1,30 @@ | ||
name: Lint | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: ["main"] | ||
paths: | ||
- "**.md" | ||
- "LICENSE" | ||
push: | ||
branches: ["*"] | ||
paths-ignore: | ||
paths: | ||
- "**.md" | ||
- "LICENSE" | ||
- "README.md" | ||
|
||
concurrency: | ||
group: ${{ github.workflow}}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint_ansible: | ||
uses: trfore/ansible-role/.github/workflows/lint_ansible.yml@main # remote repo | ||
format: | ||
uses: trfore/ansible-role/.github/workflows/format.yml@main | ||
|
||
check: | ||
needs: | ||
- format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- run: >- | ||
python -c "assert set([ | ||
'${{ needs.format.result }}', | ||
]) == {'success'}" |
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,13 +1,154 @@ | ||
# ansible | ||
*.retry | ||
*/__pycache__ | ||
*.pyc | ||
*.py[cod] | ||
*$py.class | ||
.cache | ||
/tests/output/ | ||
/changelogs/.plugin-cache.yaml | ||
|
||
# ansible extras - typical development | ||
*.deb | ||
*.tgz | ||
*.tar.gz* | ||
|
||
# ansible docs - sphinx local build files | ||
docs/rst | ||
docs/.gitignore | ||
docs/antsibull-docs.cfg | ||
docs/build.sh | ||
docs/conf.py | ||
docs/requirements.txt | ||
|
||
# general extras | ||
.DS_Store | ||
|
||
# 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/ | ||
|
||
# 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/ | ||
|
||
# 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/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
.dmypy.json | ||
dmypy.json | ||
|
||
# Pyre type checker | ||
.pyre/ |
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,4 +1,11 @@ | ||
# linted by yamllint | ||
*.yaml | ||
*.yml | ||
.pylintrc | ||
# environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# formatted by antsibull-changelog | ||
changelogs/changelog.yaml |
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,10 @@ | ||
# .prettierrc.yaml | ||
bracketSpacing: true | ||
endOfLine: "lf" | ||
printWidth: 160 | ||
proseWrap: "preserve" | ||
quoteProps: "as-needed" | ||
semi: true | ||
singleQuote: false | ||
tabWidth: 2 | ||
trailingComma: "es5" |
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Contributing | ||
|
||
## Contribute | ||
|
||
### Setup a Dev Environment | ||
|
||
```sh | ||
python3 -m venv .venv && source .venv/bin/activate | ||
python3 -m pip install -r requirements/dev-requirements.txt | ||
pre-commit install | ||
``` | ||
|
||
### Running Test | ||
|
||
```sh | ||
pre-commit run --all-files | ||
|
||
# list environments and test | ||
tox list | ||
# lint all files | ||
tox -e lint run | ||
# run a specific test environment | ||
tox -e py-ansible2.16-ubuntu20 run | ||
# run all test in parallel | ||
tox run-parallel | ||
``` | ||
|
||
- For iterative development and testing, the tox molecule environments are written to accept `molecule` arguments. This allows for codebase changes to be tested as you write across multiple distros and versions of `ansible-core`. | ||
|
||
```sh | ||
# molecule converge | ||
tox -e py-ansible2.16-ubuntu20 run -- converge -s default | ||
# molecule test w/o destroying the container | ||
tox -r -e py-ansible2.16-ubuntu20-jre8 -- test -s ubuntu20-jre8 --destroy=never | ||
``` | ||
|
||
## Additional References | ||
|
||
- [Ansible community guide](https://docs.ansible.com/ansible/devel/community/index.html) | ||
- [Github Docs: Forking a repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo#forking-a-repository) | ||
- [Ansible Docs: `ansible-core` support matrix](https://docs.ansible.com/ansible/latest/reference_appendices/release_and_maintenance.html#ansible-core-support-matrix) |
Oops, something went wrong.