mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-08-23 13:23:32 +02:00
Remove temporary linter preparation workflow
This commit is contained in:
@@ -1,109 +0,0 @@
|
|||||||
---
|
|
||||||
name: Prepare app_config linter compatibility
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- master
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
prepare:
|
|
||||||
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout pull-request branch
|
|
||||||
uses: actions/checkout@v7.0.1
|
|
||||||
with:
|
|
||||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
|
||||||
ref: ${{ github.event.pull_request.head.ref }}
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Switch repository workflows to compatibility action
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
python3 - <<'PY'
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
replacement = "uses: ./.github/actions/addon-linter"
|
|
||||||
for filename in (
|
|
||||||
".github/workflows/onpr_check-pr.yaml",
|
|
||||||
".github/workflows/onpush_builder.yaml",
|
|
||||||
):
|
|
||||||
path = Path(filename)
|
|
||||||
content = path.read_text(encoding="utf-8")
|
|
||||||
needle = "uses: frenck/action-addon-linter@v2"
|
|
||||||
count = content.count(needle)
|
|
||||||
if count != 1:
|
|
||||||
raise SystemExit(f"Expected one {needle!r} in {filename}, found {count}")
|
|
||||||
path.write_text(content.replace(needle, replacement), encoding="utf-8")
|
|
||||||
PY
|
|
||||||
|
|
||||||
- name: Run normalizer unit tests
|
|
||||||
run: python3 .github/scripts/test_prepare_addon_lint_config.py
|
|
||||||
|
|
||||||
- name: Create current-schema linter fixtures
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
mkdir -p .tmp-addon-linter-short .tmp-addon-linter-long
|
|
||||||
|
|
||||||
cat > .tmp-addon-linter-short/config.yaml <<'SHORT_FIXTURE'
|
|
||||||
---
|
|
||||||
name: App Config Short Form Fixture
|
|
||||||
version: "1.0.0"
|
|
||||||
slug: app_config_short_fixture
|
|
||||||
description: Validates current Home Assistant short-form app map names
|
|
||||||
arch:
|
|
||||||
- amd64
|
|
||||||
map:
|
|
||||||
- app_config:rw
|
|
||||||
- all_app_configs:ro
|
|
||||||
SHORT_FIXTURE
|
|
||||||
|
|
||||||
cat > .tmp-addon-linter-long/config.yaml <<'LONG_FIXTURE'
|
|
||||||
---
|
|
||||||
name: App Config Long Form Fixture
|
|
||||||
version: "1.0.0"
|
|
||||||
slug: app_config_long_fixture
|
|
||||||
description: Validates current Home Assistant long-form app map names
|
|
||||||
arch:
|
|
||||||
- amd64
|
|
||||||
map:
|
|
||||||
- type: app_config
|
|
||||||
read_only: false
|
|
||||||
- type: all_app_configs
|
|
||||||
read_only: true
|
|
||||||
LONG_FIXTURE
|
|
||||||
|
|
||||||
- name: Verify current short-form map names through upstream linter
|
|
||||||
uses: ./.github/actions/addon-linter
|
|
||||||
with:
|
|
||||||
path: ./.tmp-addon-linter-short
|
|
||||||
|
|
||||||
- name: Verify current long-form map names through upstream linter
|
|
||||||
uses: ./.github/actions/addon-linter
|
|
||||||
with:
|
|
||||||
path: ./.tmp-addon-linter-long
|
|
||||||
|
|
||||||
- name: Check prepared workflow changes
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
git diff --check
|
|
||||||
git diff --exit-code -- .github/actions/addon-linter/action.yml \
|
|
||||||
.github/scripts/prepare_addon_lint_config.py \
|
|
||||||
.github/scripts/test_prepare_addon_lint_config.py
|
|
||||||
test "$(git diff --name-only -- .github/workflows/onpr_check-pr.yaml .github/workflows/onpush_builder.yaml | wc -l)" -eq 2
|
|
||||||
|
|
||||||
- name: Export validated workflow files
|
|
||||||
uses: actions/upload-artifact@v6
|
|
||||||
with:
|
|
||||||
name: app-config-workflows
|
|
||||||
path: |
|
|
||||||
.github/workflows/onpr_check-pr.yaml
|
|
||||||
.github/workflows/onpush_builder.yaml
|
|
||||||
if-no-files-found: error
|
|
||||||
Reference in New Issue
Block a user