Skip to content
Merged
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
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
docs/** linguist-documentation
docs.ps1 linguist-vendored
build.ps1 linguist-vendored
*.ps1 linguist-vendored
58 changes: 44 additions & 14 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,25 @@ name: "Build Package"

on:
workflow_call:
inputs:
inputs: &inputs
version:
description: "Build Version"
type: string
required: true
#version-file:
# description: "Version File"
# type: string
# default: "src/*/_version.py"
name:
description: "Artifact Name"
type: string
required: true
default: "dist"
path:
description: "Build Path"
type: string
default: dist
default: "dist"
workflow_dispatch:
inputs: *inputs

jobs:
build:
Expand All @@ -19,7 +29,7 @@ jobs:
timeout-minutes: 5

permissions:
contents: read
contents: write

steps:
- name: "Checkout"
Expand All @@ -28,16 +38,14 @@ jobs:
- name: "Debug event.json"
continue-on-error: true
run: cat "${GITHUB_EVENT_PATH}"

- name: "Debug CTX github"
continue-on-error: true
env:
GITHUB_CTX: ${{ toJSON(github) }}
run: echo "$GITHUB_CTX"

#- name: "Debug Environment"
# continue-on-error: true
# run: env
- name: "Debug Environment"
continue-on-error: true
run: env

- name: "Setup Python 3.13"
uses: actions/setup-python@v6
Expand All @@ -50,29 +58,51 @@ jobs:
python -m pip install -U pip
python -m pip install --group dev

#- name: "Update Version"
# if: ${{ inputs.version-file }}
# uses: justalemon/VersionPatcher@master
# with:
# version: ${{ inputs.version }}
# initpy-files: ${{ inputs.version-file }}
#
#- name: "Debug Version"
# if: ${{ inputs.version-file }}
# continue-on-error: true
# run: |
# cat ${{ inputs.version-file }}

- name: "Build"
run: |
python -m build

- name: "List Artifacts"
continue-on-error: true
working-directory: ${{ inputs.path }}
run: |
results="$(tree . || ls -lAhR .)"
results="$(tree .)"
echo "::group::results"
echo "${results}"
echo "::endgroup::"
markdown='Artifacts: `${{ inputs.path }}`\n```text\n'"${results}"'\n```'
echo -e "${markdown}" >> $GITHUB_STEP_SUMMARY
md="Artifacts: \`${{ inputs.path }}\`\n\`\`\`text\n${results}\n\`\`\`"
echo -e "${md}" >> "$GITHUB_STEP_SUMMARY"

- name: "Upload to Actions"
uses: actions/upload-artifact@v5
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}

- name: "Upload Release"
if: ${{ github.event_name == 'release' }}
uses: cssnr/upload-release-action@latest
with:
globs: |
dist/*.whl
dist/*.tar.gz

- name: "Send Failure Notification"
if: ${{ failure() }}
uses: sarisia/actions-status-discord@v1
uses: sarisia/actions-status-discord@b8381b25576cb341b2af39926ab42c5056cc44ed # v1.15.5
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
description: ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}
description: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
9 changes: 5 additions & 4 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ jobs:
- name: "Build Docs"
run: |
python -m pip install -U pip
python -m pip install --group dev
python -m pip install -U pdoc
python -m pip install -e .
#python -m pip install -e .
python -m pdoc -t docs -o "${{ inputs.path }}" \
--logo "${{ env.logo }}" \
--logo-link "${{ env.link }}" \
vultr
src/vultr

- name: "Fix Docs"
working-directory: ${{ inputs.path }}
Expand All @@ -75,8 +76,8 @@ jobs:
echo "::group::results"
echo "${results}"
echo "::endgroup::"
markdown='Artifacts: `${{ inputs.path }}`\n```text\n'"${results}"'\n```'
echo -e "${markdown}" >> $GITHUB_STEP_SUMMARY
markdown="Artifacts: \`${{ inputs.path }}\`\n\`\`\`text\n${results}\n\`\`\`"
echo -e "${markdown}" >> "$GITHUB_STEP_SUMMARY"

- name: "Upload Pages Artifact"
if: ${{ inputs.name == 'github-pages' }}
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/labeler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: "PR Labeler"

on:
pull_request_target:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
labeler:
name: "Labeler"
runs-on: ubuntu-latest
timeout-minutes: 5

permissions:
pull-requests: write
issues: write

steps:
- name: "Checkout Configs"
uses: actions/checkout@v6
with:
repository: cssnr/configs
ref: master
path: .configs
sparse-checkout-cone-mode: false
sparse-checkout: |
labels/**

- name: "Debug"
continue-on-error: true
run: |
echo "::group::labels.yaml"
cat .configs/labels/labels.yaml
echo "::endgroup::"

echo "::group::labeler.yaml"
cat .configs/labels/labeler.yaml
echo "::endgroup::"

- name: "Label Creator"
continue-on-error: true
uses: cssnr/label-creator-action@latest
with:
file: .configs/labels/labels.yaml

- name: "Labeler"
uses: actions/labeler@v6
with:
sync-labels: true
configuration-path: .configs/labels/labeler.yaml
72 changes: 20 additions & 52 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
push:
branches: [master]
paths-ignore:
- ".gitattributes"
- ".gitignore"
- ".prettierignore"
- "MANIFEST.in"
pull_request:
branches: [master]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -30,34 +32,22 @@ jobs:
- name: "Debug event.json"
continue-on-error: true
run: cat "${GITHUB_EVENT_PATH}"

- name: "Debug CTX github"
continue-on-error: true
env:
GITHUB_CTX: ${{ toJSON(github) }}
run: echo "$GITHUB_CTX"

- name: "Debug Environment"
continue-on-error: true
run: env

#- name: "Check Changed Files"
# id: changed
# uses: tj-actions/changed-files@v47
# with:
# files: |
# src/**
# tests/**
# pyproject.toml

- name: "Setup Python 3.13"
uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: "pip"

- name: "Install"
id: install
- name: "Install Project"
run: |
python -m pip install -U pip
python -m pip install --group dev
Expand All @@ -75,7 +65,7 @@ jobs:

- name: "astral-sh/ruff"
if: ${{ !cancelled() }}
uses: astral-sh/ruff-action@v3
uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1
with:
version: latest

Expand All @@ -90,7 +80,7 @@ jobs:

- name: "isort"
if: ${{ !cancelled() }}
uses: isort/isort-action@v1
uses: isort/isort-action@24d8a7a51d33ca7f36c3f23598dafa33f7071326 # v1.1.1

- name: "mypy"
if: ${{ !cancelled() }}
Expand All @@ -107,39 +97,32 @@ jobs:
run: |
validate-pyproject pyproject.toml

- name: "prettier"
- name: "tombi"
if: ${{ !cancelled() }}
run: |
echo "::group::Install"
npm install prettier
echo "::endgroup::"
npx prettier --check .
tombi lint

- name: "yamllint"
if: ${{ !cancelled() }}
env:
CONFIG: "{extends: relaxed, ignore: [node_modules/], rules: {line-length: {max: 119}}}"
run: |
echo "::group::List Files"
yamllint -d '${{ env.CONFIG }}' --list-files .
yamllint -d .github/yamllint.yaml --list-files .
echo "::endgroup::"
yamllint -d '${{ env.CONFIG }}' .
yamllint -d .github/yamllint.yaml .

- name: "actionlint"
- name: "prettier"
if: ${{ !cancelled() }}
run: |
echo "::group::Download"
loc=$(curl -sI https://github.com/rhysd/actionlint/releases/latest | grep -i '^location:')
echo "loc: ${loc}"
tag=$(echo "${loc}" | sed -E 's|.*/tag/v?(.*)|\1|' | tr -d '\t\r\n')
echo "tag: ${tag}"
url="https://github.com/rhysd/actionlint/releases/latest/download/actionlint_${tag}_linux_amd64.tar.gz"
echo "url: ${url}"
curl -sL "${url}" | tar xz -C "${RUNNER_TEMP}" actionlint
file "${RUNNER_TEMP}/actionlint"
"${RUNNER_TEMP}/actionlint" --version
echo "::group::Install"
npm install prettier
echo "::endgroup::"
"${RUNNER_TEMP}/actionlint" -color -verbose -shellcheck= -pyflakes=
npx prettier --check .

- name: "actionlint"
if: ${{ !cancelled() }}
uses: cssnr/actionlint-action@v1
with:
shellcheck_opts: -e SC2012

- name: "pytest"
if: ${{ !cancelled() }}
Expand All @@ -151,21 +134,6 @@ jobs:

- name: "codecov"
if: ${{ !cancelled() && steps.coverage.outcome == 'success' }}
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2
with:
token: ${{ secrets.CODECOV_TOKEN }}

#- name: "hadolint"
# if: ${{ !cancelled() }}
# uses: hadolint/hadolint-action@v3.3.0
# with:
# dockerfile: Dockerfile

#- name: "Vale"
# if: ${{ !cancelled() }}
# uses: errata-ai/vale-action@v2.1.1

#- name: "SonarQube"
# uses: SonarSource/sonarqube-scan-action@v4
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Loading
Loading