Skip to content

Commit

Permalink
feat!: rewrite hetznercloud molecule driver (ansible-community#46)
Browse files Browse the repository at this point in the history
Co-authored-by: Julian Tölle <julian.toelle97@gmail.com>

build: rewrite packaging config

docs: the hetzner.hcloud collection require ansible-core>=2.13

docs: add project history

feat: update driver schema

feat: require instance volumes name
  BREAKING CHANGE: the instance volumes now require a `name`

feat: require python>=3.9
  BREAKING CHANGE: the molecule driver drops support for python version <3.9

feat: require molecule >=5.0,<7.0
  BREAKING CHANGE: the molecule driver drops support for molecule version <5.0

feat: rename driver name to `molecule_hetznercloud` 
  BREAKING CHANGE: the molecule driver name was renamed from `hetznercloud` to `molecule_hetznercloud`

feat: instance `server_type` now defaults to `cx11`

fix: remove unused dependencies

fix: remove ansible-compat dependency

test: setup e2e tests

ci: setup release pipeline

ci: add stale bot job

chore: clean previous maintainer "personal" files
  • Loading branch information
jooola authored Oct 4, 2023
1 parent 06a6347 commit 36a28f4
Show file tree
Hide file tree
Showing 74 changed files with 1,267 additions and 2,353 deletions.
92 changes: 0 additions & 92 deletions .drone.yml

This file was deleted.

11 changes: 0 additions & 11 deletions .envrc.sample

This file was deleted.

3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
extend-ignore =
E501
3 changes: 0 additions & 3 deletions .github/funding.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release please

on:
push:
branches: [main]

jobs:
release-please:
# The secret HCLOUD_BOT_TOKEN is only available on the main repo, not in forks.
if: github.repository == 'ansible-community/molecule-hetznercloud'

runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
token: ${{ secrets.HCLOUD_BOT_TOKEN }}
release-type: python
package-name: molecule-hetznercloud

extra-files: |
molecule_hetznercloud/_version.py
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

on:
push:
branches: [main]
pull_request:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.x

- name: Install dependencies
run: pip install build twine

- name: Build
run: python3 -m build

- name: Check
run: twine check dist/*

- name: Publish
if: github.event_name == 'release'
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*
24 changes: 24 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Close stale issues

on:
schedule:
- cron: "30 12 * * *"

permissions:
issues: write
pull-requests: write

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v8
with:
stale-issue-message: "This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs."
exempt-issue-labels: "pinned"
stale-issue-labels: "stale"
stale-pr-message: "This PR has been marked as stale because it has not had recent activity. The bot will close the PR if no further action occurs."
exempt-pr-labels: "pinned"
stale-pr-labels: "stale"
days-before-stale: 90
days-before-close: 30
63 changes: 63 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Test

on:
push:
branches: [main]
pull_request:

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

name: Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
make venv
venv/bin/pip install tox tox-gh-actions
- name: Run tests
run: make test

integration:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]

permissions:
id-token: write

name: Integration Python ${{ matrix.python-version }}
steps:
- uses: hetznercloud/tps-action@main

- uses: actions/checkout@v3

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
make venv
venv/bin/pip install tox tox-gh-actions
- name: Run integrations
run: make integration
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
122 changes: 119 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
ansible_collections

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -20,7 +22,6 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
Expand All @@ -42,5 +43,120 @@ htmlcov/
.tox/
.nox/
.coverage
*.xml
*egg*
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# 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
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .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

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__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/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
Loading

0 comments on commit 36a28f4

Please sign in to comment.