mirror of
https://github.com/gofiber/storage.git
synced 2025-12-19 00:38:24 +08:00
63 lines
1.9 KiB
YAML
63 lines
1.9 KiB
YAML
name: Golangci-Lint Check
|
|
on:
|
|
push:
|
|
branches:
|
|
- "master"
|
|
- "main"
|
|
paths-ignore:
|
|
- "**.md"
|
|
- LICENSE
|
|
- ".github/ISSUE_TEMPLATE/*.yml"
|
|
- ".github/dependabot.yml"
|
|
pull_request:
|
|
branches:
|
|
- "*"
|
|
paths-ignore:
|
|
- "**.md"
|
|
- LICENSE
|
|
- ".github/ISSUE_TEMPLATE/*.yml"
|
|
- ".github/dependabot.yml"
|
|
workflow_dispatch:
|
|
jobs:
|
|
changes:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Fetch Repository
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Generate filters
|
|
id: filter-setup
|
|
run: |
|
|
filters=$(find . -maxdepth 1 -type d ! -path ./.git ! -path . ! -path ./testhelpers -exec basename {} \; | grep -v '^\.' | awk '{printf "%s: \"%s/**\"\n", $1, $1}')
|
|
# Add all testhelpers subdirectories to filters
|
|
testhelpers_filters=$(find ./testhelpers -mindepth 1 -maxdepth 1 -type d -exec basename {} \; | awk '{printf "testhelpers/%s: \"testhelpers/%s/**\"\n", $1, $1}')
|
|
echo "filters<<EOF" >> $GITHUB_OUTPUT
|
|
echo "$filters" >> $GITHUB_OUTPUT
|
|
echo "$testhelpers_filters" >> $GITHUB_OUTPUT
|
|
echo "EOF" >> $GITHUB_OUTPUT
|
|
shell: bash
|
|
- name: Filter changes
|
|
id: filter
|
|
uses: dorny/paths-filter@v3
|
|
with:
|
|
filters: ${{ steps.filter-setup.outputs.filters }}
|
|
outputs:
|
|
packages: ${{ steps.filter.outputs.changes || '[]' }}
|
|
lint:
|
|
needs: changes
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
package: ${{ fromJSON(needs.changes.outputs.packages || '[]') }}
|
|
steps:
|
|
- name: Fetch Repository
|
|
uses: actions/checkout@v6
|
|
- name: Run golangci-lint
|
|
uses: reviewdog/action-golangci-lint@v2
|
|
with:
|
|
golangci_lint_flags: "--tests=false --timeout=5m"
|
|
workdir: ${{ matrix.package }}
|
|
fail_level: "warning"
|
|
filter_mode: nofilter
|