Skip to content

Commit

Permalink
Merge pull request #88 from os-climate/update-devops-tooling
Browse files Browse the repository at this point in the history
Chore: Update DevOps tooling from central repository [skip ci]
  • Loading branch information
ModeSevenIndustrialSolutions authored Jun 10, 2024
2 parents 8eb9e46 + edb0af0 commit 265fcfa
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 42 deletions.
10 changes: 9 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ updates:
directory: "/" # Location of package manifests
commit-message:
prefix: "[dependabot] Chore:"
open-pull-requests-limit: 1
open-pull-requests-limit: 3
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
commit-message:
prefix: "[dependabot] Chore:"
open-pull-requests-limit: 3
schedule:
interval: "weekly"
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: "Publish documentation"
if: success()
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ on:
push:
# Only invoked on release tag pushes
branches:
- '**'
- 'main'
- 'master'
tags:
- 'v*.*.*'

Expand Down Expand Up @@ -55,7 +56,7 @@ jobs:
### SIGNING ###

- name: "Sign packages with Sigstore"
uses: sigstore/gh-action-sigstore-python@v2.1.1
uses: sigstore/gh-action-sigstore-python@v2
with:
inputs: >-
./dist/*.tar.gz
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
### SIGNING ###

- name: "Sign packages with Sigstore"
uses: sigstore/gh-action-sigstore-python@v2.1.1
uses: sigstore/gh-action-sigstore-python@v2

with:
inputs: >-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
python -m pip install --upgrade pip
pdm export -o requirements.txt
pip install -r requirements.txt
pip install --upgrade pytest
pip install --upgrade pytest pytest-cov
pip install .
- name: "Run unit tests: pytest"
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Temporary devops repo
.devops
/.devops

# Twine temporary files
package-lock.json
Expand Down Expand Up @@ -103,8 +103,8 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/
/.pybuilder/
/target/

# Jupyter Notebook
.ipynb_checkpoints
Expand Down
41 changes: 11 additions & 30 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,32 +50,19 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace

# Autoformat: YAML, JSON, Markdown, etc.
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
args:
['--no-error-on-unmatched-pattern', '--ignore-unknown']

# Lint: Markdown
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.40.0
rev: v0.41.0
hooks:
- id: markdownlint
args: ["--fix"]

# - repo: https://github.com/psf/black-pre-commit-mirror
# rev: 24.4.2
# hooks:
# - id: black
# - id: black-jupyter

# - repo: https://github.com/tomcatling/black-nb
# rev: '0.7'
# hooks:
# - id: black-nb

- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
Expand All @@ -98,14 +85,8 @@ repos:
- id: pydocstyle
additional_dependencies: ["tomli"]

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]

- repo: https://github.com/Mateusz-Grzelinski/actionlint-py
rev: v1.6.27.13
rev: v1.7.0.14
hooks:
- id: actionlint

Expand All @@ -122,23 +103,23 @@ repos:
- id: yamllint
args: [ "-d", "{rules: {line-length: {max: 120}}, ignore-from-file: [.gitignore],}", ]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.10.0"
hooks:
- id: mypy
verbose: true
args: [--show-error-codes]
additional_dependencies: ["pytest", "types-requests"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.3
rev: v0.4.5
hooks:
- id: ruff
files: ^(scripts|tests|custom_components)/.+\.py$
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
files: ^(scripts|tests|custom_components)/.+\.py$

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.10.0"
hooks:
- id: mypy
verbose: true
args: ["--show-error-codes", "--install-types", "--non-interactive"]
additional_dependencies: ["pytest", "types-requests"]

# Check for misspellings in documentation files
# - repo: https://github.com/codespell-project/codespell
# rev: v2.2.2
Expand Down
16 changes: 13 additions & 3 deletions scripts/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ SOURCE_FILE="bootstrap.yaml"
WGET_URL="https://raw.githubusercontent.com/os-climate/devops-toolkit/main/.github/workflows/$SOURCE_FILE"
AUTOMATION_BRANCH="update-devops-tooling"
DEVOPS_DIR=".devops"
FETCH_MODE="wget"

### Checks ###

Expand All @@ -21,14 +22,17 @@ fi

WGET_CMD=$(which wget)
if [ ! -x "$WGET_CMD" ]; then
echo "WGET command was NOT found in PATH"; exit 1
echo "WGET command was NOT found in PATH; using CURL"
FETCH_MODE="curl"
fi

MKTEMP_CMD=$(which mktemp)
if [ ! -x "$MKTEMP_CMD" ]; then
echo "MKTEMP command was NOT found in PATH"; exit 1
fi



SHELL_SCRIPT=$(mktemp -t script-XXXXXXXX.sh)

### Functions ###
Expand Down Expand Up @@ -95,9 +99,15 @@ if [ -f "$SOURCE_FILE" ]; then
echo "Removing existing copy of: $SOURCE_FILE"
rm "$SOURCE_FILE"
fi
echo "Pulling latest DevOps bootstrap workflow from:"
echo "Pulling latest DevOps bootstrap YAML from:"
echo " $WGET_URL"
"$WGET_CMD" -q "$WGET_URL"
if [ "$FETCH_MODE" = "wget" ]; then
"$WGET_CMD" -q "$WGET_URL" > /dev/null 2>&1
fi
if [ ! -f "$SOURCE_FILE" ]; then
echo "Attempting to retrieve YAML file with CURL"
curl "$WGET_URL" > "$SOURCE_FILE"
fi

# The section below extracts shell code from the YAML file
echo "Extracting shell code from: $SOURCE_FILE"
Expand Down

0 comments on commit 265fcfa

Please sign in to comment.