diff --git a/.ansible/.ansible.cfg b/.ansible.cfg similarity index 100% rename from .ansible/.ansible.cfg rename to .ansible.cfg diff --git a/.ansible/playbooks/setup-linux.yml b/.ansible/playbooks/setup-linux.yml index ed1e773..117d2e0 100644 --- a/.ansible/playbooks/setup-linux.yml +++ b/.ansible/playbooks/setup-linux.yml @@ -35,13 +35,13 @@ - name: Import VS Code installation tasks ansible.builtin.import_tasks: tasks/apt-release-code.yml - when: apt.releases.code | default(false) | bool + when: (apt.releases.code | default(false)) if apt.releases is defined else false become: true tags: [apt, code, vscode] - name: Import Brave installation tasks ansible.builtin.import_tasks: tasks/apt-release-brave.yml - when: apt.releases.brave | default(false) | bool + when: (apt.releases.brave | default(false)) if apt.releases is defined else false become: true tags: [apt, brave] diff --git a/.ansible/variables-example.yml b/.ansible/variables-example.yml index 16b2d70..7c832f0 100644 --- a/.ansible/variables-example.yml +++ b/.ansible/variables-example.yml @@ -71,6 +71,7 @@ dotfiles: .bash_options: true .bash_profile: true .bashrc: true + .codespellrc: true .ctags: true .curlrc: true .editorconfig: true diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..bebeb73 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,3 @@ +[codespell] +skip = .git,*.pdf,*.svg +ignore-words-list = AKS diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..66ce28d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +--- +# Dependabot configuration file. +# @docs: + +version: 2 +updates: + # Enable version updates for npm + - package-ecosystem: "npm" + # Look for `package.json` and `lock` files in the `root` directory + directory: "/" + # Check the npm registry for updates every day (weekdays) + schedule: + interval: "weekly" diff --git a/.github/workflows/check-pr-comment.yml b/.github/workflows/check-pr-comment.yml new file mode 100644 index 0000000..a477230 --- /dev/null +++ b/.github/workflows/check-pr-comment.yml @@ -0,0 +1,22 @@ +--- +name: Check — PR Comment +# yamllint disable-line rule:truthy +on: + workflow_run: + workflows: + - Check + types: + - completed +permissions: + actions: read + checks: read + issues: write + pull-requests: write +jobs: + comment: + uses: kenorb/.github/.github/workflows/check-pr-comment.yml@main + with: + conclusion: ${{ github.event.workflow_run.conclusion }} + head_sha: ${{ github.event.workflow_run.head_sha }} + run_id: ${{ github.event.workflow_run.id }} + run_url: ${{ github.event.workflow_run.html_url }} diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index badf688..b81cfa4 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,26 +1,13 @@ --- name: Check - -# yamllint disable-line rule:truthy on: pull_request: push: - + schedule: + - cron: 0 0 * * 1 # Run every Monday at 00:00 UTC + workflow_dispatch: jobs: - Pre-commit: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: ~/.cache/pre-commit - key: pre-commit|${{ hashFiles('.pre-commit-config.yaml') }} - - uses: actions/setup-python@v5 - - name: Installs shfmt - run: > - curl -fsSL "$SHFMT_URL" | sudo tee /usr/local/bin/shfmt >/dev/null && - sudo chmod +x /usr/local/bin/shfmt - env: - # yamllint disable rule:line-length - SHFMT_URL: https://github.com/mvdan/sh/releases/download/v3.1.1/shfmt_v3.1.1_linux_amd64 - - uses: pre-commit/action@v3.0.1 + check: + uses: kenorb/.github/.github/workflows/check.yml@main + with: + submodules: 'false' # Set to 'true' or 'recursive' if repository uses submodules diff --git a/.github/workflows/devcontainer-ci.yml b/.github/workflows/devcontainer-ci.yml index a1820e7..827e58a 100644 --- a/.github/workflows/devcontainer-ci.yml +++ b/.github/workflows/devcontainer-ci.yml @@ -7,11 +7,6 @@ on: paths: - .devcontainer/** - .github/workflows/devcontainer-ci.yml - types: - - opened - - synchronize - - reopened - - ready_for_review push: branches: - dev @@ -21,131 +16,13 @@ on: - .github/workflows/devcontainer-ci.yml schedule: - cron: 0 0 * * 1 # Run every Monday at 00:00 UTC - workflow_call: - # IMPORTANT: When calling this reusable workflow from another repository, - # you MUST grant 'packages: write' permission in the calling workflow. - # Example: - # jobs: - # devcontainer: - # uses: Cogni-AI-OU/.github/.github/workflows/devcontainer-ci.yml@main - # permissions: - # contents: read - # packages: write # Required for pushing to GitHub Container Registry - inputs: - required_commands: - description: Space-separated list of required command-line tools - required: false - type: string - default: '' - required_python_packages: - description: Space-separated list of required Python packages - required: false - type: string - default: '' -env: - # Keep the commands and packages in lexicographical order. - REQUIRED_COMMANDS: >- - ${{ inputs.required_commands != '' && inputs.required_commands || 'actionlint - ansible - docker - gh - make - node - npm - pip - pre-commit - python3 - rg' }} - REQUIRED_PYTHON_PACKAGES: >- - ${{ inputs.required_python_packages != '' && inputs.required_python_packages || 'ansible - ansible-lint - docker - molecule - pre-commit - uv' }} + workflow_dispatch: permissions: contents: read packages: write jobs: devcontainer-build: if: github.event_name != 'pull_request' || !github.event.pull_request.draft - name: Build & Test - permissions: - contents: read - packages: write # Enables push to GHCR - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v6 - with: - fetch-depth: 0 - - name: Login to GitHub Container Registry - uses: docker/login-action@v4.2.0 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Set image name - id: image - run: | - # Transform repository name to valid Docker tag format - # 1. Convert to lowercase (Docker tags must be lowercase) - # 2. Remove leading dots from path components (Docker components must start with alphanumeric) - REPO_NAME="${{ github.repository }}" - REPO_LOWER="${REPO_NAME,,}" - # Remove /. pattern to handle repos like "org/.github" -> "org/github" - SAFE_REPO_NAME="${REPO_LOWER//\/\./\/}" - echo "name=ghcr.io/${SAFE_REPO_NAME}/devcontainer" >> "$GITHUB_OUTPUT" - - name: Check cache image existence - id: cache_check - continue-on-error: true - run: | - IMAGE_NAME="${{ steps.image.outputs.name }}" - echo "Checking if cache image exists: ${IMAGE_NAME}:latest" - if docker pull "${IMAGE_NAME}:latest" 2>/dev/null; then - echo "✓ Cache image found: ${IMAGE_NAME}:latest" - echo "exists=true" >> "$GITHUB_OUTPUT" - else - echo "⚠ Cache image not found: ${IMAGE_NAME}:latest" - echo "⚠ Build will proceed without cache (first build or image expired)" - echo "exists=false" >> "$GITHUB_OUTPUT" - fi - - name: Build and test dev container - uses: devcontainers/ci@v0.3 - with: - imageName: ${{ steps.image.outputs.name }} - cacheFrom: ${{ steps.image.outputs.name }} - push: filter - refFilterForPush: refs/heads/main - runCmd: |- - echo "Testing devcontainer build..." - - # Check all required commands are installed - echo "Checking required command-line tools..." - for cmd in $REQUIRED_COMMANDS; do - if ! command -v "$cmd" &> /dev/null; then - echo "✗ $cmd is not installed" - exit 1 - fi - echo "✓ $cmd is installed" - done - - # Check all required Python packages are installed - echo "Checking required Python packages..." - for pkg in $REQUIRED_PYTHON_PACKAGES; do - if ! python3 -m pip show "$pkg" &> /dev/null; then - echo "✗ Required Python package '$pkg' is missing" - exit 1 - fi - echo "✓ $pkg is installed" - done - echo "✓ All required Python packages are installed" - - # Verify pre-commit can run (hooks may not be installed in CI container) - if pre-commit --version &> /dev/null; then - echo "✓ pre-commit is functional" - else - echo "✗ pre-commit is not functional" - exit 1 - fi - echo "✓ All devcontainer tests passed!" + # See: https://docs.github.com/en/actions/how-tos/reuse-automations/reuse-workflows + uses: kenorb/.github/.github/workflows/devcontainer-ci.yml@main + secrets: inherit # pragma: allowlist secret diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 4772fca..0000000 --- a/.gitmodules +++ /dev/null @@ -1,21 +0,0 @@ -[submodule "scripts/python/UStream-recorder"] - path = scripts/python/UStream-recorder - url = git@github.com:kenorb/UStream-recorder.git -[submodule "other/adamv"] - path = other/adamv - url = https://github.com/adamv/dotfiles -[submodule "mathiasbynens"] - path = other/mathiasbynens - url = https://github.com/mathiasbynens/dotfiles -[submodule "cowboy"] - path = other/cowboy - url = https://github.com/cowboy/dotfiles -[submodule "bin"] - path = bin - url = https://github.com/kenorb/binfiles -[submodule "git-aware-prompt"] - path = .bash/git-aware-prompt - url = https://github.com/jimeh/git-aware-prompt.git -[submodule "bsclifton"] - path = other/bsclifton - url = https://github.com/bsclifton/dotfiles diff --git a/.vscode/settings.json b/.vscode/settings.json index 8405386..a2fdbfb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,5 +1,7 @@ { "chat.tools.terminal.autoApprove": { + "git rev-parse": true, + "git submodule": true, "locale": true, "pipenv": true, "pre-commit": true diff --git a/bin b/bin deleted file mode 160000 index 176bbd8..0000000 --- a/bin +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 176bbd89f999ea2350b386c12d96b30a0b667163 diff --git a/other/adamv b/other/adamv deleted file mode 160000 index f6a2cab..0000000 --- a/other/adamv +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f6a2cab9bcd48b515dd3f9a0925c374e053e8f04 diff --git a/other/bsclifton b/other/bsclifton deleted file mode 160000 index 5e43493..0000000 --- a/other/bsclifton +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5e43493e3a8bdbbb1e976c676089809b1c2e3756 diff --git a/other/cowboy b/other/cowboy deleted file mode 160000 index 4a27245..0000000 --- a/other/cowboy +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4a272459f0b27d7a63922f61819795ecd25d1d7e diff --git a/other/mathiasbynens b/other/mathiasbynens deleted file mode 160000 index b569363..0000000 --- a/other/mathiasbynens +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b569363084cee4cad6cdeda1d3546711b0a4f0c2