Skip to content

Commit

Permalink
ci: rework based on PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau committed Oct 23, 2024
1 parent de2d318 commit 238caed
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 64 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/cla-check.yaml

This file was deleted.

7 changes: 7 additions & 0 deletions .github/workflows/policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
name: Check policy
on:
pull_request:

jobs:
policy:
uses: lengau/starflow/.github/workflows/policy.yaml@work/CRAFT-3602/test-workflows
44 changes: 3 additions & 41 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,6 @@ on:

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run linters
uses: lengau/starflow/lint@work/CRAFT-3602/test-action
unit-tests:
strategy:
matrix:
platform:
- ubuntu-latest
- [noble, arm64] # Self-hosted Ubuntu Noble runner to test arm64
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Run unit tests with coverage
uses: lengau/starflow/test-python@work/CRAFT-3602/test-action
with:
python-versions: 3.10 3.11 3.12 3.13
tics-token: ${{ secrets.TICSAUTHTOKEN }}
integration-tests:
strategy:
matrix:
platform:
- ubuntu-latest
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Run integration tests
uses: lengau/starflow/test-python@work/CRAFT-3602/test-action
with:
python-versions: 3.10 3.12
target: test-integration
lowest-tests: # Run unit and integration tests on the oldest Python available with UV
runs-on: ubuntu-latest
env:
UV_RESOLUTION: lowest
steps:
- uses: actions/checkout@v4
- uses: lengau/starflow/test-python@work/CRAFT-3602/test-action
with:
python-versions: "3.10"
uses: lengau/starflow/.github/workflows/lint-python.yaml@work/CRAFT-3602/test-workflows
test:
uses: lengau/starflow/.github/workflows/test-python.yaml@work/CRAFT-3602/test-workflows
28 changes: 14 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ setup-docs: install-uv ##- Set up a documentation-only environment

.PHONY: setup-precommit
setup-precommit: install-uv ##- Set up pre-commit hooks in this repository.
ifeq ($(shell command -v pre-commit),)
ifeq ($(shell which pre-commit),)
uv tool install pre-commit
endif
pre-commit install
Expand Down Expand Up @@ -96,7 +96,7 @@ lint-mypy: ##- Check types with mypy

.PHONY: lint-pyright
lint-pyright: ##- Check types with pyright
ifneq ($(shell command -v pyright),) # Prefer the system pyright
ifneq ($(shell which pyright),) # Prefer the system pyright
pyright --pythonpath .venv/bin/python
else
# Fix for a bug in npm
Expand Down Expand Up @@ -157,7 +157,7 @@ package-pip: ##- Build packages for pip (sdist, wheel)

.PHONY: package-snap
package-snap: snap/snapcraft.yaml ##- Build snap package
ifeq ($(shell command -v snapcraft),)
ifeq ($(shell which snapcraft),)
sudo snap install --classic snapcraft
endif
snapcraft pack
Expand All @@ -184,10 +184,10 @@ clean: ## Clean up the development environment

.PHONY: install-uv
install-uv:
ifneq ($(shell command -v uv),)
else ifneq ($(shell command -v snap),)
ifneq ($(shell which uv),)
else ifneq ($(shell which snap),)
sudo snap install --classic astral-uv
else ifneq ($(shell command -v brew),)
else ifneq ($(shell which brew),)
brew install uv
else ifeq ($(OS),Windows_NT)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Expand All @@ -197,18 +197,18 @@ endif

.PHONY: install-codespell
install-codespell:
ifneq ($(shell command -v codespell),)
else ifneq ($(shell command -v snap),)
ifneq ($(shell which codespell),)
else ifneq ($(shell which snap),)
sudo snap install codespell
else ifneq ($(shell command -v brew),)
else ifneq ($(shell which brew),)
make install-uv
uv tool install codespell
endif

.PHONY: install-ruff
install-ruff:
ifneq ($(shell command -v ruff),)
else ifneq ($(shell command -v snap),)
ifneq ($(shell which ruff),)
else ifneq ($(shell which snap),)
sudo snap install ruff
else
make install-uv
Expand All @@ -217,9 +217,9 @@ endif

.PHONY: install-shellcheck
install-shellcheck:
ifneq ($(shell command -v shellcheck),)
else ifneq ($(shell command -v snap),)
ifneq ($(shell which shellcheck),)
else ifneq ($(shell which snap),)
sudo snap install shellcheck
else ifneq ($(shell command -v brew),)
else ifneq ($(shell which brew),)
brew install shellcheck
endif

0 comments on commit 238caed

Please sign in to comment.