Skip to content

Commit

Permalink
Yaml lint (#334)
Browse files Browse the repository at this point in the history
* Create .yamlignore
* Create .yamllint
* Create workflow_yaml_lint.yml

* Yaml Lint in AppVeyour
* Yaml Lint in Freetype2
* Yaml Lint in Mediaportal
* Yaml Lint in Mediaportal Jira
* Yaml Lint in Mediaportal Release
* Yaml Lint in Mediaportal Test Build
* Yaml Lint in Pull Request Labeler
* Yaml Lint in Workflow Milestone
* Yaml Lint in Workflow Code Scanning - CodeQL
* Yaml Lint in Workflow Size and Stability labels
  • Loading branch information
andrewjswan authored Sep 19, 2024
1 parent 1a71d93 commit 7735cba
Show file tree
Hide file tree
Showing 13 changed files with 162 additions and 116 deletions.
17 changes: 11 additions & 6 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
critical:
- '(Critical|critical|Urgent|urgent)'
- '(Critical|critical|Urgent|urgent)'

enhancement:
- '(Enhancement|enhancement)'
- '(Enhancement|enhancement)'

Engine:
- '(Core|core)'
- '(Core|core)'

TV:
- '(TV|TVE)'
- '(TV|TVE)'

Tuning:
- '(Tuning|tuning)'
- '(Tuning|tuning)'

MPE:
- 'MPE'
- 'MPE'
94 changes: 47 additions & 47 deletions .github/workflows/mediaportal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Mediaportal
on:
push:
# On Push to Master branch
branches:
branches:
- master
# Ignore all Tags / Release
tags-ignore:
Expand All @@ -26,62 +26,62 @@ jobs:
build:
strategy:
matrix:
architecture: [x86, x64]
architecture: [x86, x64]

name: Build Mediaportal

runs-on: windows-2019

steps:
- name: Setup Visual Studio 2019
uses: microsoft/setup-msbuild@v2
with:
vs-version: 16.11
- name: Setup Visual Studio 2019
uses: microsoft/setup-msbuild@v2
with:
vs-version: 16.11

- name: Link to Visual Studio 2019 Community
run: |
mklink /J "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
shell: cmd
- name: Link to Visual Studio 2019 Community
run: |
mklink /J "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
shell: cmd

- name: Setup Java JDK
uses: actions/setup-java@v4
with:
java-version: 8
architecture: x86
distribution: temurin
- name: Setup Java JDK
uses: actions/setup-java@v4
with:
java-version: 8
architecture: x86
distribution: temurin

- name: Setup NSIS
run: |
choco install --yes nsis --version=3.09 --force
- name: Setup NSIS
run: |
choco install --yes nsis --version=3.09 --force
- name: Git Checkout
uses: actions/checkout@v4
- name: Git Checkout
uses: actions/checkout@v4

- name: Git Submodule Update
run: |
git submodule update --init --recursive
- name: Git Submodule Update
run: |
git submodule update --init --recursive
- name: Build
run: |
BuildFullinstaller.cmd LOG ${{ matrix.architecture }}
working-directory: ${{ github.workspace }}\Build
shell: cmd
- name: Build
run: |
BuildFullinstaller.cmd LOG ${{ matrix.architecture }}
working-directory: ${{ github.workspace }}\Build
shell: cmd

- name: Upload Artifact / Build result file
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: Build result file ${{ matrix.architecture }}
path: |
${{ github.workspace }}\Build\BuildFullInstaller.log
retention-days: ${{ inputs.retention-logs || 3 }}
- name: Upload Artifact / Build result file
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: Build result file ${{ matrix.architecture }}
path: |
${{ github.workspace }}\Build\BuildFullInstaller.log
retention-days: ${{ inputs.retention-logs || 3 }}

- name: Upload Artifact / Mediaportal setup file
uses: actions/upload-artifact@v4
if: ${{ success() }}
with:
name: Mediaportal setup file ${{ matrix.architecture }}
path: |
${{ github.workspace }}\Release\MediaPortalSetup_*.exe
retention-days: ${{ inputs.retention-build || 90 }}
if-no-files-found: error
- name: Upload Artifact / Mediaportal setup file
uses: actions/upload-artifact@v4
if: ${{ success() }}
with:
name: Mediaportal setup file ${{ matrix.architecture }}
path: |
${{ github.workspace }}\Release\MediaPortalSetup_*.exe
retention-days: ${{ inputs.retention-build || 90 }}
if-no-files-found: error
4 changes: 2 additions & 2 deletions .github/workflows/mediaportal_jira.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ name: Mediaportal / Jira
on:
push:
# On Push to Master branch
branches:
branches:
- 'MP1-**'
# Ignore all Tags / Release
tags-ignore:
- '**'
- '**'

workflow_call:
inputs:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/mediaportal_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ jobs:
build:
name: Mediaportal Build
uses: ./.github/workflows/mediaportal.yml

release:
name: Release Mediaportal
needs: build
permissions:
contents: write

runs-on: ubuntu-latest

steps:
- name: Download x86 Artifacts
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -53,7 +53,7 @@ jobs:
needs: [build, release]
permissions:
security-events: write

ci-status:
name: Status
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mediaportal_test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Mediaportal / Test Build
on:
push:
# On Push to Pre Release / Final Test branch
branches:
branches:
- 'MP1.**_Test**'
# Ignore all Tags / Release
tags-ignore:
Expand Down
82 changes: 41 additions & 41 deletions .github/workflows/workflow_codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,44 @@ jobs:
security-events: write

steps:
- name: Setup Visual Studio 2019
uses: microsoft/setup-msbuild@v2
with:
vs-version: 16.11

- name: Link to Visual Studio 2019 Community
run: |
mklink /J "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
shell: cmd

- name: Setup Java JDK
uses: actions/setup-java@v4
with:
java-version: 8
architecture: x86
distribution: temurin

- name: Setup NSIS
run: |
choco install --yes nsis --version=3.09 --force
- name: Git Checkout
uses: actions/checkout@v4

- name: Git Submodule Update
run: |
git submodule update --init --recursive
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: csharp

- name: Build
run: |
BuildFullinstaller.cmd
working-directory: ${{ github.workspace }}\Build
shell: cmd
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
- name: Setup Visual Studio 2019
uses: microsoft/setup-msbuild@v2
with:
vs-version: 16.11

- name: Link to Visual Studio 2019 Community
run: |
mklink /J "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community" "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
shell: cmd

- name: Setup Java JDK
uses: actions/setup-java@v4
with:
java-version: 8
architecture: x86
distribution: temurin

- name: Setup NSIS
run: |
choco install --yes nsis --version=3.09 --force
- name: Git Checkout
uses: actions/checkout@v4

- name: Git Submodule Update
run: |
git submodule update --init --recursive
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: csharp

- name: Build
run: |
BuildFullinstaller.cmd
working-directory: ${{ github.workspace }}\Build
shell: cmd

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
16 changes: 8 additions & 8 deletions .github/workflows/workflow_labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ name: "Workflow / Pull Request Labeler"
on:
pull_request_target:
types: [opened, edited]

jobs:
labeler:
name: Add labels to Pull Request

runs-on: ubuntu-latest

steps:
- name: Add labels to Pull Request
uses: github/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler.yml
enable-versioned-regex: 0
include-title: 1
- name: Add labels to Pull Request
uses: github/[email protected]
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/labeler.yml
enable-versioned-regex: 0
include-title: 1
2 changes: 1 addition & 1 deletion .github/workflows/workflow_milestone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Workflow / Milestone"

on:
pull_request_target:
types:
types:
- opened
- closed

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/workflow_size_labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ on:
jobs:
add-labels:
name: Add labels

runs-on: ubuntu-latest

permissions:
contents: read
pull-requests: write
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/workflow_yaml_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Workflow / YAML lint

on:
push:
branches: [main]
paths:
- "**.yaml"
- "**.yml"
pull_request:
paths:
- "**.yaml"
- "**.yml"
workflow_dispatch:

jobs:
yamllint:
name: 🧹 Yaml Lint
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out configuration from GitHub
uses: actions/checkout@v4
- name: 🚀 Run yamllint
run: yamllint --strict .
2 changes: 2 additions & 0 deletions .yamlignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/libbluray/*.yaml
/libbluray/*.yml
19 changes: 19 additions & 0 deletions .yamllint
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
extends: default

ignore-from-file: [.gitignore, .yamlignore]

rules:
document-start: disable
empty-lines:
level: error
max: 1
max-start: 0
max-end: 1
indentation:
level: error
spaces: 2
indent-sequences: true
check-multi-line-strings: false
line-length: disable
truthy: disable
Loading

0 comments on commit 7735cba

Please sign in to comment.