mirror of
https://github.com/kolesa-team/pve-purestorage-plugin.git
synced 2026-08-12 21:53:06 -06:00
1c719ba7f8
* Bump tj-actions/changed-files from 44 to 47 in /.github/workflows Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 44 to 47. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v44...v47) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-version: '47' dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: timansky <timansky@kolesa.team>
113 lines
3.8 KiB
YAML
113 lines
3.8 KiB
YAML
name: Checks
|
|
run-name: Checks on ${{ github.ref_name }} by ${{ github.actor }}
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
- reopened
|
|
workflow_dispatch:
|
|
inputs:
|
|
check_all_files:
|
|
description: 'Check all files (not just changed)'
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
check-changes:
|
|
name: Check changed files
|
|
runs-on: ubuntu-22.04
|
|
outputs:
|
|
check-all: ${{ steps.set-check-all.outputs.check-all }}
|
|
perl-changed: ${{ steps.changed-files-perl.outputs.any_changed }}
|
|
markdown-changed: ${{ steps.changed-files-markdown.outputs.any_changed }}
|
|
test-changed: ${{ steps.changed-files-test.outputs.any_changed }}
|
|
perl-files: ${{ steps.set-perl-files.outputs.files }}
|
|
markdown-files: ${{ steps.set-markdown-files.outputs.files }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Determine if we should check all files
|
|
id: set-check-all
|
|
run: |
|
|
# Check all files only for manual workflow dispatch with check_all_files=true
|
|
# For PRs, check only changed files
|
|
if [ "${{ github.event_name }}" == "workflow_dispatch" ] && [ "${{ inputs.check_all_files }}" == "true" ]; then
|
|
echo "check-all=true" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "check-all=false" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Check changed Perl files
|
|
id: changed-files-perl
|
|
uses: tj-actions/changed-files@v47
|
|
with:
|
|
files: |
|
|
**/*.pm
|
|
**/*.pl
|
|
|
|
- name: Check changed Markdown files
|
|
id: changed-files-markdown
|
|
uses: tj-actions/changed-files@v47
|
|
with:
|
|
files: |
|
|
**/*.md
|
|
|
|
- name: Check changed test files
|
|
id: changed-files-test
|
|
uses: tj-actions/changed-files@v47
|
|
with:
|
|
files: |
|
|
tests/**/*.t
|
|
tests/**/*.pl
|
|
|
|
- name: Set Perl files to check
|
|
id: set-perl-files
|
|
run: |
|
|
if [ "${{ steps.set-check-all.outputs.check-all }}" == "true" ]; then
|
|
files=$(find . -type f \( -name "*.pm" -o -name "*.pl" \) ! -path "*/node_modules/*" ! -path "*/.git/*" | tr '\n' ' ')
|
|
echo "files=$files" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "files=${{ steps.changed-files-perl.outputs.all_changed_files }}" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Set Markdown files to check
|
|
id: set-markdown-files
|
|
run: |
|
|
if [ "${{ steps.set-check-all.outputs.check-all }}" == "true" ]; then
|
|
files=$(find . -type f -name "*.md" ! -path "*/node_modules/*" ! -path "*/.git/*" | tr '\n' ' ')
|
|
echo "files=$files" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "files=${{ steps.changed-files-markdown.outputs.all_changed_files }}" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
lint:
|
|
name: Lint
|
|
needs: check-changes
|
|
if: |
|
|
(needs.check-changes.outputs.check-all == 'true') ||
|
|
(needs.check-changes.outputs.perl-changed == 'true' || needs.check-changes.outputs.markdown-changed == 'true')
|
|
uses: ./.github/workflows/lint.yml
|
|
with:
|
|
enable-perl-lint: ${{ needs.check-changes.outputs.check-all == 'true' || needs.check-changes.outputs.perl-changed == 'true' }}
|
|
enable-markdown-lint: ${{ needs.check-changes.outputs.check-all == 'true' || needs.check-changes.outputs.markdown-changed == 'true' }}
|
|
perl-files: ${{ needs.check-changes.outputs.perl-files }}
|
|
markdown-files: ${{ needs.check-changes.outputs.markdown-files }}
|
|
|
|
test:
|
|
name: Tests
|
|
needs: check-changes
|
|
if: |
|
|
(needs.check-changes.outputs.check-all == 'true') ||
|
|
(needs.check-changes.outputs.perl-changed == 'true' || needs.check-changes.outputs.test-changed == 'true')
|
|
uses: ./.github/workflows/tests.yml
|