diff --git a/.github/workflows/docker-lint.yml b/.github/workflows/docker-lint.yml new file mode 100644 index 000000000000..e003f0d40cf9 --- /dev/null +++ b/.github/workflows/docker-lint.yml @@ -0,0 +1,51 @@ +name: Docker lint + +# Cancel workflow if there is a new change to the branch. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +on: + merge_group: + pull_request: + branches: + - main + paths: + - "**/Dockerfile*" + - "**/*.dockerfile" + - "monitored-stack/docker-compose.yml" + - "monitored-stack/.env.example" + - ".github/workflows/docker-lint.yml" + push: + branches: + - main + paths: + - "**/Dockerfile*" + - "**/*.dockerfile" + - "monitored-stack/docker-compose.yml" + - "monitored-stack/.env.example" + - ".github/workflows/docker-lint.yml" + +jobs: + docker-lint: + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v6 + - name: validate compose file + run: | + cp monitored-stack/.env.example monitored-stack/.env + docker compose -f monitored-stack/docker-compose.yml config + - uses: hadolint/hadolint-action@v3.3.0 + with: + dockerfile: "Dockerfile*" + recursive: true + # https://github.com/hadolint/hadolint/wiki/DL3008 + # https://github.com/hadolint/hadolint/wiki/DL3018 + ignore: DL3008,DL3018 + - uses: hadolint/hadolint-action@v3.3.0 + with: + dockerfile: "*.dockerfile" + recursive: true + # https://github.com/hadolint/hadolint/wiki/DL3008 + # https://github.com/hadolint/hadolint/wiki/DL3018 + ignore: DL3008,DL3018 diff --git a/.github/workflows/lists-lint.yml b/.github/workflows/lists-lint.yml new file mode 100644 index 000000000000..72099fd721bc --- /dev/null +++ b/.github/workflows/lists-lint.yml @@ -0,0 +1,34 @@ +name: Lists lint + +# Cancel workflow if there is a new change to the branch. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +on: + merge_group: + pull_request: + branches: + - main + paths: + - "src/tool/subcommands/api_cmd/test_snapshots_ignored.txt" + - "src/tool/subcommands/api_cmd/test_snapshots.txt" + - ".github/workflows/lists-lint.yml" + push: + branches: + - main + paths: + - "src/tool/subcommands/api_cmd/test_snapshots_ignored.txt" + - "src/tool/subcommands/api_cmd/test_snapshots.txt" + - ".github/workflows/lists-lint.yml" + +jobs: + lists-lint: + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v6 + - uses: jdx/mise-action@v3 + - name: Sort and verify lists + run: | + mise lint:lists + git diff --exit-code diff --git a/.github/workflows/python-lint.yml b/.github/workflows/python-lint.yml new file mode 100644 index 000000000000..976e262c77a6 --- /dev/null +++ b/.github/workflows/python-lint.yml @@ -0,0 +1,37 @@ +name: Python lint + +# Cancel workflow if there is a new change to the branch. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +on: + merge_group: + pull_request: + branches: + - main + paths: + - "**/*.py" + - ".github/workflows/python-lint.yml" + push: + branches: + - main + paths: + - "**/*.py" + - ".github/workflows/python-lint.yml" + +jobs: + python-lint: + if: ${{ !startsWith(github.ref, 'refs/heads/gh-readonly-queue/') }} + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: "3.12" + - run: pip install black flake8 + - name: Run Python linters + uses: wearerequired/lint-action@v2 + with: + black: true + flake8: true diff --git a/.github/workflows/rubocop.yml b/.github/workflows/rubocop.yml new file mode 100644 index 000000000000..93aa4a66dce7 --- /dev/null +++ b/.github/workflows/rubocop.yml @@ -0,0 +1,29 @@ +name: Rubocop + +# Cancel workflow if there is a new change to the branch. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +on: + merge_group: + pull_request: + branches: + - main + paths: + - "**/*.rb" + - ".github/workflows/rubocop.yml" + push: + branches: + - main + paths: + - "**/*.rb" + - ".github/workflows/rubocop.yml" + +jobs: + rubocop: + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v6 + - uses: jdx/mise-action@v3 + - run: mise lint:ruby diff --git a/.github/workflows/scripts-lint.yml b/.github/workflows/scripts-lint.yml deleted file mode 100644 index 2ebd2aff4f86..000000000000 --- a/.github/workflows/scripts-lint.yml +++ /dev/null @@ -1,82 +0,0 @@ -name: Script linters - -# Cancel workflow if there is a new change to the branch. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} - -on: - merge_group: - pull_request: - branches: - - main - push: - branches: - - main - -jobs: - shellcheck: - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@v6 - - uses: jdx/mise-action@v3 - - name: Run shellcheck - run: mise lint:shellcheck - - rubocop: - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@v6 - - uses: jdx/mise-action@v3 - - run: mise lint:ruby - python-lint: - if: ${{ !startsWith(github.ref, 'refs/heads/gh-readonly-queue/') }} - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@v6 - - uses: actions/setup-python@v6 - with: - python-version: "3.12" - - run: pip install black flake8 - - name: Run Python linters - uses: wearerequired/lint-action@v2 - with: - black: true - flake8: true - docker-lint: - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@v6 - - name: validate compose file - run: | - cp monitored-stack/.env.example monitored-stack/.env - docker compose -f monitored-stack/docker-compose.yml config - - uses: hadolint/hadolint-action@v3.3.0 - with: - dockerfile: "Dockerfile*" - recursive: true - # https://github.com/hadolint/hadolint/wiki/DL3008 - # https://github.com/hadolint/hadolint/wiki/DL3018 - ignore: DL3008,DL3018 - - uses: hadolint/hadolint-action@v3.3.0 - with: - dockerfile: "*.dockerfile" - recursive: true - # https://github.com/hadolint/hadolint/wiki/DL3008 - # https://github.com/hadolint/hadolint/wiki/DL3018 - ignore: DL3008,DL3018 - yaml-lint: - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@v6 - - uses: jdx/mise-action@v3 - - run: mise lint:yaml - lists-lint: - runs-on: ubuntu-24.04-arm - steps: - - uses: actions/checkout@v6 - - uses: jdx/mise-action@v3 - - name: Sort and verify lists - run: | - mise lint:lists - git diff --exit-code diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 000000000000..47865c3462ee --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,30 @@ +name: Shellcheck + +# Cancel workflow if there is a new change to the branch. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +on: + merge_group: + pull_request: + branches: + - main + paths: + - "**/*.sh" + - ".github/workflows/shellcheck.yml" + push: + branches: + - main + paths: + - "**/*.sh" + - ".github/workflows/shellcheck.yml" + +jobs: + shellcheck: + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v6 + - uses: jdx/mise-action@v3 + - name: Run shellcheck + run: mise lint:shellcheck diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yaml-lint.yml new file mode 100644 index 000000000000..ed9e91733937 --- /dev/null +++ b/.github/workflows/yaml-lint.yml @@ -0,0 +1,31 @@ +name: YAML lint + +# Cancel workflow if there is a new change to the branch. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +on: + merge_group: + pull_request: + branches: + - main + paths: + - "**/*.yml" + - "**/*.yaml" + - ".github/workflows/yaml-lint.yml" + push: + branches: + - main + paths: + - "**/*.yml" + - "**/*.yaml" + - ".github/workflows/yaml-lint.yml" + +jobs: + yaml-lint: + runs-on: ubuntu-24.04-arm + steps: + - uses: actions/checkout@v6 + - uses: jdx/mise-action@v3 + - run: mise lint:yaml