Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub: Updates and splits the super-linter and yaml linter. #6159

Merged
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
45 changes: 10 additions & 35 deletions .github/workflows/super-linter.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
# This workflow executes several linters on changed files based on languages used in your code base whenever
# you push a code or open a pull request.
#
# You can adjust the behavior by modifying this file.
# For more information, see:
# https://github.com/github/super-linter
# This workflow uses https://github.com/github/super-linter

name: Lint Code Base

on:
push:
branches: [main]
pull_request:
branches: [main]

# Lets you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
run-lint:
name: Lint Multiple
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Checkout files
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

sparse-checkout: |
.github
php
python
ruby
kotlin
- name: Lint Code Base
uses: github/super-linter@v4
env:
Expand All @@ -37,22 +31,3 @@ jobs:
VALIDATE_PYTHON_BLACK: true
VALIDATE_RUBY: true
VALIDATE_KOTLIN: true
yamllint:
name: Lint Yaml
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: checkout repo content
uses: actions/checkout@v3 # checkout the repository content to github runner.
- name: setup python
uses: actions/setup-python@v3
with:
python-version: 3.11 #install the python needed
- name: Install dependencies
run: >-
python3 -m pip install -r .tools/base_requirements.txt
- name: Lint metadata files
run: >-
yamllint --format standard -c .tools/validation/.yamllint.yaml .doc_gen/metadata
36 changes: 36 additions & 0 deletions .github/workflows/yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Lint Metadata Yaml

on:
pull_request:
workflow_dispatch:

jobs:
yamllint:
name: Lint Yaml
runs-on: ubuntu-latest
steps:
- name: Checkout files
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
.doc_gen/metadata
.tools
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
files: ".doc_gen/metadata/**/*.{yml,yaml}"
- name: Setup Python
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install dependencies
if: steps.changed-files.outputs.any_changed == 'true'
run: >-
python3 -m pip install -r .tools/base_requirements.txt
- name: Lint metadata files
if: steps.changed-files.outputs.any_changed == 'true'
run: >-
yamllint --format standard -c .tools/validation/.yamllint.yaml .doc_gen/metadata
Loading