Skip to content

Commit

Permalink
ci: add actionlint
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau committed Jan 20, 2025
1 parent f0a7848 commit b00dee4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
- name: Begin async installations
id: install
run: |
pyright_change=$(sudo snap install --no-wait --classic pyright)
shellcheck_change=$(sudo snap install --no-wait shellcheck)
uv_change=$(sudo snap install --no-wait --classic astral-uv)
ruff_change=$(sudo snap install --no-wait ruff)
echo snap_changes="$pyright_change $shellcheck_change $uv_change $ruff_change" >> $GITHUB_OUTPUT
pyright_change="$(sudo snap install --no-wait --classic pyright)"
shellcheck_change="$(sudo snap install --no-wait shellcheck)"
uv_change="$(sudo snap install --no-wait --classic astral-uv)"
ruff_change="$(sudo snap install --no-wait ruff)"
echo snap_changes="$pyright_change $shellcheck_change $uv_change $ruff_change" >> "$GITHUB_OUTPUT"
- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -61,6 +61,7 @@ jobs:
- name: Test across all Python versions
shell: bash
run: |
# shellcheck disable=SC2086
for python_version in $PYTHON_VERSIONS; do
echo ::group::Python $python_version
make test UV_PYTHON=$python_version
Expand All @@ -71,6 +72,7 @@ jobs:
- name: Test with the lowest supported libraries
shell: bash
run: |
# shellcheck disable=SC2086
for python_version in $PYTHON_VERSIONS; do
echo ::group::Python $python_version
make test UV_PYTHON=$python_version UV_RESOLUTION=lowest
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ repos:
- id: rstcheck
additional_dependencies:
- rstcheck[toml,sphinx]
- repo: https://github.com/rhysd/actionlint
rev: v1.7.7
hooks:
- id: actionlint
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ lint-types:
uv run --group lint pyright
uv run --group lint mypy

.PHONY: lint-actions
lint-actions: install-actionlint
actionlint

.PHONY: test
test:
uv run pytest
Expand All @@ -61,3 +65,13 @@ else
$(warning Unknown how to install dependencies on this system. Please install the equivalents of the following debian packages:)
$(info libxml2-dev libxslt1-dev clang)
endif

.PHONY: install-actionlint
install-actionlint:
ifneq ($(shell which actionlint),)
@# Actionlint already installed
else ifneq ($(shell which go),)
go install github.com/rhysd/actionlint/cmd/actionlint@latest
else
$(error Please install go to use actionlint)
endif

0 comments on commit b00dee4

Please sign in to comment.