Skip to content

Commit

Permalink
Merge pull request #29 from remerge/CORE-533
Browse files Browse the repository at this point in the history
Update template
  • Loading branch information
hollow committed Feb 22, 2024
2 parents 3af07e6 + c729354 commit 6bfea48
Show file tree
Hide file tree
Showing 11 changed files with 436 additions and 537 deletions.
3 changes: 1 addition & 2 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
---
# Changes here will be overwritten by Copier
_commit: v2.2.0
_commit: v2.9.0
_src_path: gh:remerge/template
project_id: ansible-role-nomad
project_license: apache-2.0
project_name: Ansible Role for Nomad
project_owner: core
project_type: ansible-role
run_workflows_for_all_branches: false
use_python: true
4 changes: 3 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
strict_env

# Loads a ".env" file into the current environment
dotenv_if_exists
dotenv_if_exists "${PWD}"/../.env
dotenv_if_exists "${PWD}"/.env

# Add local scripts to PATH
PATH_add "${PWD}/bin"
Expand All @@ -30,6 +31,7 @@ fi

# Load poetry virtual env
if [[ ! -d "${PWD}/.venv" ]]; then
# link the poetry virtualenv to .venv for other tools to use
ln -nfs "$(poetry run poetry env info -p)" "${PWD}/.venv"
fi

Expand Down
8 changes: 8 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
self-hosted-runner:
labels:
- generic
- self-hosted
- nomad
- docker
- default
26 changes: 22 additions & 4 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,42 @@ on:
push:
branches: [main, master]

permissions: read-all
permissions:
actions: none
checks: none
contents: read
deployments: none
discussions: none
id-token: none
issues: none
packages: none
pages: none
pull-requests: none
repository-projects: none
security-events: none
statuses: none

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
# https://github.com/actions/checkout/releases
uses: actions/checkout@v4

- name: Install poetry
# https://github.com/snok/install-poetry/releases
uses: snok/install-poetry@v1

- name: Setup Python
uses: actions/setup-python@v4
# https://github.com/actions/setup-python/releases
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"
cache: "poetry"

- name: Load envrc
# https://github.com/HatsuneMiku3939/direnv-action/releases
uses: HatsuneMiku3939/direnv-action@v1

- name: Setup pre-commit
Expand All @@ -34,4 +51,5 @@ jobs:
run: make install

- name: Run pre-commit checks
uses: pre-commit/action@v3.0.0
# https://github.com/pre-commit/action/releases
uses: pre-commit/action@v3.0.1
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -573,3 +573,6 @@ id_*
# only.
!*.tfvars
!*.tfvars.json

# Ignore direnv files
.direnv/
Expand Down
5 changes: 2 additions & 3 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
MD013:
tables: false
code_blocks: false
# MD013/line-length
MD013: false
11 changes: 6 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ repos:

# https://github.com/pre-commit/mirrors-prettier/tags
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.3"
rev: "v3.1.0"
hooks:
- id: prettier
exclude: "^project/"

# https://github.com/igorshubovych/markdownlint-cli/tags
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: "v0.37.0"
rev: "v0.39.0"
hooks:
- id: markdownlint-fix
name: markdownlint

# https://github.com/adrienverge/yamllint/tags
- repo: https://github.com/adrienverge/yamllint
rev: "v1.32.0"
rev: "v1.35.1"
hooks:
- id: yamllint
entry: yamllint --strict
Expand All @@ -74,7 +74,7 @@ repos:

# https://github.com/ansible/ansible-lint/tags
- repo: https://github.com/ansible/ansible-lint
rev: "v6.21.1"
rev: "v24.2.0"
hooks:
- id: ansible-lint
name: ansible-lint
Expand All @@ -96,7 +96,7 @@ repos:

# https://github.com/bridgecrewio/checkov/tags
- repo: https://github.com/bridgecrewio/checkov
rev: "3.0.21"
rev: "3.2.22"
hooks:
- id: checkov
name: checkov
Expand All @@ -113,3 +113,4 @@ repos:
rev: "v0.19.0"
hooks:
- id: woke-from-source
args: [--config=.woke.yaml]
1 change: 1 addition & 0 deletions .woke.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
893 changes: 380 additions & 513 deletions poetry.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ description = "Ansible Role for Nomad"
authors = ["Remerge GmbH <core@remerge.io>"]

[tool.poetry.dependencies]
python = "^3.9"
python = "^3.10, < 3.12"

[tool.poetry.group.dev.dependencies]
black = "^23.10.1"
flake8 = "^6.1.0"
flake8-bugbear = "^23.9.16"
pylint = "^3.0.2"
tox = "^4.11.3"
molecule = { extras = ["docker"], version = "^6.0.2" }
ansible-lint = { version = "^6.21.1", markers = "platform_system != 'Windows'" }
black = "^24.2.0"
flake8 = "^7.0.0"
flake8-bugbear = "^24.2.6"
pylint = "^3.0.3"
tox = "^4.13.0"
molecule = { extras = ["docker"], version = "^24.2.0" }
ansible-lint = { version = "^24.2.0", markers = "platform_system != 'Windows'" }

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
3 changes: 2 additions & 1 deletion python.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ update:: python-update

.PHONY: python-clean
python-clean: ## remove current Python virtualenv
poetry env remove python
poetry env remove python || :
rm -rf .venv
clean:: python-clean

0 comments on commit 6bfea48

Please sign in to comment.