Merge pull request #1907 from gofiber/dependabot/go_modules/couchbase… #2709
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Repository | |
uses: actions/checkout@v4 | |
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@v4 | |
- 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 |