diff --git a/.github/actions/cpan-test/action.yml b/.github/actions/cpan-test/action.yml index 11dc06c..0b4e9f1 100644 --- a/.github/actions/cpan-test/action.yml +++ b/.github/actions/cpan-test/action.yml @@ -88,4 +88,3 @@ runs: name: cpan_log path: /home/runner/.cpanm/work/*/build.log retention-days: 5 - diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..bc1f60c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: CI + +on: + push: + branches: [main] + paths: + - '**.yml' + - '**.yaml' + - '.yamllint' + pull_request: + branches: [main] + paths: + - '**.yml' + - '**.yaml' + - '.yamllint' + workflow_dispatch: + +permissions: {} + +jobs: + yaml-lint: + uses: ./.github/workflows/yaml-lint.yml diff --git a/.github/workflows/cpan-complexity.yml b/.github/workflows/cpan-complexity.yml index cf5a659..07fe77a 100644 --- a/.github/workflows/cpan-complexity.yml +++ b/.github/workflows/cpan-complexity.yml @@ -22,4 +22,3 @@ jobs: - name: Run countperl run: | countperl lib - diff --git a/.github/workflows/cpan-kwality.yml b/.github/workflows/cpan-kwality.yml index bfb44eb..53285cc 100644 --- a/.github/workflows/cpan-kwality.yml +++ b/.github/workflows/cpan-kwality.yml @@ -15,4 +15,3 @@ jobs: run: | perlcritic . continue-on-error: true - diff --git a/.github/workflows/cpan-perlcritic.yml b/.github/workflows/cpan-perlcritic.yml index 22c439a..2f1058a 100644 --- a/.github/workflows/cpan-perlcritic.yml +++ b/.github/workflows/cpan-perlcritic.yml @@ -19,4 +19,3 @@ jobs: run: | perlcritic -${{ inputs.level }} . continue-on-error: true - diff --git a/.github/workflows/cpan-release.yml b/.github/workflows/cpan-release.yml index 1ba99d4..6ee0bde 100644 --- a/.github/workflows/cpan-release.yml +++ b/.github/workflows/cpan-release.yml @@ -38,4 +38,3 @@ jobs: jq -r .name META.json jq -r .version META.json ls -l *.tar.gz - diff --git a/.github/workflows/cpan-test.yml b/.github/workflows/cpan-test.yml index 640ce07..914c2f9 100644 --- a/.github/workflows/cpan-test.yml +++ b/.github/workflows/cpan-test.yml @@ -33,4 +33,3 @@ jobs: perl_version: ${{ matrix.perl }} os: ${{ matrix.os }} testing_context: ${{ inputs.testing_context }} - diff --git a/.github/workflows/yaml-lint.yml b/.github/workflows/yaml-lint.yml new file mode 100644 index 0000000..91397d7 --- /dev/null +++ b/.github/workflows/yaml-lint.yml @@ -0,0 +1,19 @@ +name: YAML Linting + +on: + workflow_call: + +permissions: + contents: read + +jobs: + yaml-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Install yamllint + run: | + pip install yamllint==1.38.0 + - name: Run yamllint + run: | + yamllint . diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..37e0c33 --- /dev/null +++ b/.yamllint @@ -0,0 +1,20 @@ +--- +extends: default + +rules: + # Allow longer lines for GitHub Actions workflows (URLs, etc.) + line-length: + max: 120 + level: warning + + # Document start is not required for GitHub Actions + document-start: disable + + # Limit trailing empty lines to 1 maximum + empty-lines: + max: 1 + + # Allow truthy values (on, off, yes, no) in GitHub Actions + truthy: + allowed-values: ['true', 'false', 'on', 'off'] + check-keys: false diff --git a/README.md b/README.md index 9dbccb0..0224cff 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,10 @@ Runs `perlcritic` against your Perl code * ***level***: A number from 1 to 5 defining how brutal `perlcritic` will be. The default is 5 +#### yaml-lint + +Lints YAML files using `yamllint` to ensure they follow best practices and are properly formatted + ### In early development These workflows aren't guaranteed to do what they need to yet. They'll probably change quickly