Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate to Makefiles and starflow #590

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions .github/workflows/cla-check.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
name: Security scan
name: Check policy
on:
pull_request:
push:
branches:
- main
- hotfix/*
- work/secscan # For development
- work/check-policy # For development

jobs:
policy:
uses: canonical/starflow/.github/workflows/policy.yaml@main
python-scans:
name: Scan Python project
name: Security scan
uses: canonical/starflow/.github/workflows/scan-python.yaml@main
with:
packages: python-apt-dev
20 changes: 20 additions & 0 deletions .github/workflows/qa.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: QA
on:
push:
branches:
- "main"
- "feature/*"
- "hotfix/*"
- "release/*"
- "renovate/*"
pull_request:

jobs:
lint:
uses: canonical/starflow/.github/workflows/lint-python.yaml@main
test:
uses: canonical/starflow/.github/workflows/test-python.yaml@main
with:
fast-test-platforms: '[["jammy", "amd64"], ["noble", "amd64"], "macos-14-large"]'
slow-test-platforms: '["jammy", "macos-14-large"]'
lowest-test-platform: jammy
143 changes: 0 additions & 143 deletions .github/workflows/tests.yaml

This file was deleted.

71 changes: 71 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
PROJECT=craft_application
ifneq ($(wildcard /etc/os-release),)
include /etc/os-release
export
endif

ifneq ($(VERSION_CODENAME),)
SETUP_TESTS_EXTRA_ARGS=--group apt-$(VERSION_CODENAME)
endif

UV_FROZEN=true

include common.mk

.PHONY: format
format: format-ruff format-codespell ## Run all automatic formatters

.PHONY: lint
lint: lint-ruff lint-codespell lint-mypy lint-pyright lint-shellcheck lint-yaml lint-docs lint-twine ## Run all linters

.PHONY: pack
pack: pack-pip ## Build all packages

.PHONY: publish
publish: publish-pypi ## Publish packages

.PHONY: publish-pypi
publish-pypi: clean package-pip lint-twine ##- Publish Python packages to pypi
uv tool run twine upload dist/*

# Used for installing build dependencies in CI.
.PHONY: install-build-deps
install-build-deps: install-lint-build-deps install-macos-build-deps install-linux-build-deps

# If additional build dependencies need installing in order to build the linting env.
.PHONY: install-lint-build-deps
install-lint-build-deps:

.PHONY: install-linux-build-deps
install-linux-build-deps:
ifneq ($(OS),Linux)
else ifeq ($(shell which apt-get),)
$(warning apt-get not found. Please install dependencies yourself.)
else
sudo $(APT) install skopeo
# Needed for integration testing.
sudo $(APT) install libyaml-dev python3-dev python3-pip python3-setuptools python3-venv python3-wheel
# Needed for python-apt.
sudo $(APT) install python-apt-dev libapt-pkg-dev clang
# For overlay tests
sudo $(APT) install fuse-overlayfs
endif
ifneq ($(shell which snap),)
sudo snap install lxd
sudo snap install --edge fetch-service || sudo snap refresh --amend --edge fetch-service
endif
ifneq ($(shell which lxd),)
sudo lxd init --auto
endif

.PHONY: install-macos-build-deps
install-macos-build-deps:
ifneq ($(OS),Darwin)
else ifeq ($(shell which brew),)
$(warning brew not installed. Please install dependencies yourself.)
else
brew install [email protected] # For building pygit2
sudo cp -R /usr/local/opt/[email protected]/* /usr/local
brew install multipass
brew install skopeo
endif
Loading
Loading