-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
74 changed files
with
6,110 additions
and
2,663 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# GitHub CODEOWNERS. See: | ||
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners | ||
# Remember, the last match takes precedence. | ||
|
||
# Global owner, used as a last resort. | ||
* @lengau | ||
|
||
# Documentation owners | ||
/docs/ @medubelko @lengau | ||
|
||
# Finally, all CODEOWNERS changes need to be approved by The Man, Himself. | ||
/.github/CODEOWNERS @sergiusens |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: QA | ||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "feature/*" | ||
- "hotfix/*" | ||
- "release/*" | ||
- "renovate/*" | ||
pull_request: | ||
merge_group: | ||
|
||
jobs: | ||
lint: | ||
uses: canonical/starflow/.github/workflows/lint-python.yaml@main | ||
test: | ||
uses: canonical/starflow/.github/workflows/test-python.yaml@main | ||
with: | ||
# Self-hosted Jammy and Noble runners, GH-hosted macos and Windows runners. | ||
# Limiting to amd64 is a workaround for https://github.com/canonical/charmcraft/issues/2018 | ||
fast-test-platforms: '[["jammy", "amd64"], ["noble", "amd64"], "macos-13", "macos-14-large", "windows-2019", "windows-2022"]' | ||
# Slow tests run on noble to avoid an issue with old skopeo versions. | ||
slow-test-platforms: '["noble", "macos-14-large"]' | ||
# Switch to just noble when we fix #2018 | ||
lowest-python-platform: self-hosted-linux-amd64-noble-large |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,117 +13,8 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Begin snap installs | ||
run: | | ||
echo "Installing snaps in the background while running apt and pip..." | ||
sudo snap install --no-wait shellcheck ruff | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
cache: 'pip' | ||
- name: Configure environment | ||
run: | | ||
echo "::group::pip install" | ||
python -m pip install tox | ||
echo "::endgroup::" | ||
echo "::group::Create virtual environments for linting processes." | ||
tox run -m lint --notest | ||
echo "::endgroup::" | ||
echo "::group::Wait for snap to complete" | ||
snap watch --last=install | ||
echo "::endgroup::" | ||
- name: Run Linters | ||
run: tox run --skip-pkg-install --no-list-dependencies -m lint | ||
run-tests: | ||
strategy: | ||
matrix: | ||
os: [ubuntu-22.04, ubuntu-24.04, macos-12, macos-13, windows-2019, windows-2022] | ||
include: | ||
- os: windows-2019 | ||
python-version: | | ||
3.11 | ||
3.12 | ||
- os: windows-2022 | ||
python-version: | | ||
3.11 | ||
3.12 | ||
- os: macos-12 | ||
python_version: | | ||
3.10 | ||
3.12 | ||
- os: macos-13 | ||
python_version: | | ||
3.10 | ||
3.12 | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
if: ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
- name: Install Ubuntu-specific dependencies | ||
if: ${{ startsWith(matrix.os, 'ubuntu') }} | ||
run: | | ||
sudo apt update | ||
sudo apt install -y python3-pip python3-setuptools python3-wheel python3-venv libapt-pkg-dev | ||
pipx install poetry | ||
# Jammy runners have too old a version of pip. | ||
if [[ $(lsb_release --codename --short) == 'jammy' ]]; then | ||
python3 -m pip install -U pip | ||
fi | ||
- name: Setup LXD | ||
uses: canonical/[email protected] | ||
if: ${{ runner.os == 'Linux' }} | ||
- name: Install skopeo (mac) | ||
# This is only necessary for Linux until skopeo >= 1.11 is in repos. | ||
# Once we're running on Noble, we can get skopeo from apt. | ||
if: ${{ runner.os == 'macOS' }} | ||
run: | | ||
brew install skopeo | ||
- name: Install skopeo (Linux) | ||
if: ${{ runner.os == 'Linux' }} | ||
run: | | ||
if [[ $(cat /etc/os-release | grep VERSION_CODENAME) == 'VERSION_CODENAME=jammy' ]]; then | ||
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" | ||
brew install skopeo | ||
sudo rm -f /bin/skopeo | ||
sudo ln -s $(which skopeo) /bin/skopeo | ||
else | ||
sudo apt install skopeo | ||
fi | ||
# Allow skopeo to access the contents of /run/containers | ||
sudo chmod 777 /run/containers | ||
# Add an xdg runtime dir for skopeo to look into for an auth.json file | ||
sudo mkdir -p /run/user/$(id -u) | ||
sudo chown $USER /run/user/$(id -u) | ||
- name: Configure environment | ||
run: | | ||
pipx install tox | ||
tox run --colored yes -m tests --notest | ||
- name: Run tests | ||
shell: bash | ||
run: | | ||
if [[ $(uname --kernel-name) == "Linux" ]]; then | ||
export XDG_RUNTIME_DIR=/run/user/$(id -u) | ||
fi | ||
tox run --skip-pkg-install --no-list-dependencies --result-json results/tox-${{ matrix.platform }}.json --colored yes -m tests | ||
snap-build: | ||
runs-on: ubuntu-22.04 | ||
runs-on: [self-hosted, amd64] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
@@ -235,17 +126,18 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- name: Set up uv with caching | ||
id: setup-uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
python-version: '3.11' | ||
enable-cache: true | ||
- name: Install dependencies | ||
run: | | ||
pip install -U pyinstaller -r requirements.txt | ||
pip install . | ||
uv sync --no-dev | ||
uv pip install pyinstaller | ||
- name: Build | ||
run: | | ||
pyinstaller charmcraft.spec | ||
uv run pyinstaller charmcraft.spec | ||
- name: Upload unsigned exe | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
|
@@ -296,7 +188,7 @@ jobs: | |
macos-smoke-test: | ||
strategy: | ||
matrix: | ||
os: [macos-12, macos-13] | ||
os: [macos-13, macos-14-large] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
# Installing and caching homebrew using the action should speed up subsequent CI: | ||
|
@@ -314,26 +206,33 @@ jobs: | |
- name: Install Homebrew Bundler RubyGems | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: brew install-bundler-gems | ||
- name: Install Multipass | ||
- name: Install dependencies with homebrew | ||
run: | | ||
brew install multipass | ||
brew install [email protected] # For building pygit2 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Set up uv with caching | ||
id: setup-uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
cache: 'pip' | ||
- name: Build and install Charmcraft | ||
run: | | ||
pipx install . | ||
uv sync --no-dev | ||
- name: Check for fully-configured multipass | ||
run: | | ||
while ! multipass version; do | ||
sleep 1 | ||
done | ||
- name: Init and pack | ||
run: | | ||
source .venv/bin/activate | ||
mkdir test-charm | ||
cd test-charm | ||
export CRAFT_VERBOSITY_LEVEL=trace | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: "v5.0.0" | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-yaml | ||
- id: check-added-large-files | ||
- id: check-merge-conflict | ||
- id: check-toml | ||
- id: fix-byte-order-marker | ||
- id: mixed-line-ending | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: "v0.8.1" | ||
hooks: | ||
# Run the linter | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
# Run the formatter | ||
- id: ruff-format | ||
- repo: https://github.com/adrienverge/yamllint.git | ||
rev: "v1.35.1" | ||
hooks: | ||
- id: yamllint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.