Skip to content

linters

linters #365

Workflow file for this run

name: linters
on:
workflow_dispatch:
push:
branches:
- master
paths-ignore:
- '**/*.md'
- '**/*.yml'
- '.cz'
- '.gitignore'
pull_request:
branches:
- master
paths-ignore:
- '**/*.md'
- '**/*.yml'
- '.cz'
- '.gitignore'
schedule:
- cron: '4 4 * * 6'
permissions:
contents: read
jobs:
list-ebuild:
name: list-ebuild
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44.3.0
with:
since_last_remote_commit: true
files: |
**/*.ebuild
- name: Set matrix
id: set-matrix
run: |
echo "::set-output name=matrix::$(dirname ${{ steps.changed-files.outputs.all_changed_files }} | jq -Rsc 'split("\n")[:-1]|unique')"
repoman:
name: repoman
needs: list-ebuild
runs-on: ubuntu-latest
strategy:
matrix:
ebuild: ${{ fromJson(needs.list-ebuild.outputs.matrix) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Define exclutions
uses: dorny/paths-filter@v3
id: filter
with:
base: 'master'
filters: |
exclusion:
- 'net-misc/dhcdrop/*'
- 'app-emulation/vmware-workstation/*'
- 'net-im/vk-messenger-bin/*'
- name: Define repoman path
uses: haya14busa/action-cond@v1
id: condition-path
with:
cond: ${{ github.event_name == 'schedule' }}
if_true: "."
if_false: "${{ matrix.ebuild }}"
- name: Define repoman args
uses: haya14busa/action-cond@v1
id: condition-args
with:
cond: ${{ steps.filter.outputs.exclusion == 'true' }}
if_true: "-dxv"
if_false: "-dxv -e y"
- name: Run repoman on ${{ matrix.ebuild }}
uses: lucianposton/repoman-ebuild-qa-action@v1
with:
path: ${{ steps.condition-path.outputs.value }}
repoman_args: ${{ steps.condition-args.outputs.value }}
portage_version: 3.0.30
shellcheck:
name: shellcheck
needs: list-ebuild
runs-on: ubuntu-latest
strategy:
matrix:
ebuild: ${{ fromJson(needs.list-ebuild.outputs.matrix) }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Define shellcheck path
uses: haya14busa/action-cond@v1
id: condition
with:
cond: ${{ github.event_name == 'schedule' }}
if_true: "."
if_false: "${{ matrix.ebuild }}"
- name: Run shellcheck for ebuild on ${{ matrix.ebuild }}
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: -s bash -e SC2034 -e SC2016
with:
additional_files: '*.ebuild'
ignore_names: '*.bash *.zsh'
scandir: ${{ steps.condition.outputs.value }}
- name: Run shellcheck for init on ${{ matrix.ebuild }}
uses: ludeeus/action-shellcheck@master
env:
SHELLCHECK_OPTS: -s sh -e SC2034
with:
additional_files: '*.initd'
ignore_names: '*.bash *.zsh'
scandir: ${{ steps.condition.outputs.value }}
pkgcheck:
name: pkgcheck
needs: list-ebuild
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v44.3.0
with:
since_last_remote_commit: true
files: |
**/*.ebuild
- name: Get specific changed files
id: changed-files-specific
uses: tj-actions/changed-files@v44.3.0
with:
since_last_remote_commit: true
files: |
app-admin/awsls/*.ebuild
app-admin/sinker/*.ebuild
app-admin/sops/*.ebuild
app-admin/terraform-provider-vcd/*.ebuild
app-backup/clickhouse-backup/*.ebuild
app-backup/wal-g/*.ebuild
dev-db/litestream/*.ebuild
dev-db/usql/*.ebuild
dev-util/act/*.ebuild
dev-util/dtm/*.ebuild
dev-vcs/gitaly/*.ebuild
app-metrics/amazon-cloudwatch-agent/*.ebuild
app-metrics/aws-otel-collector/*.ebuild
app-misc/fq/*.ebuild
app-misc/gron/*.ebuild
app-misc/pet/*.ebuild
dev-util/packer/*.ebuild
dev-util/tickgit/*.ebuild
net-analyzer/sx/*.ebuild
net-misc/curlie/*.ebuild
net-misc/wuzz/*.ebuild
www-servers/gitlab-workhorse/*.ebuild
- name: Define pkgcheck args
uses: haya14busa/action-cond@v1
id: condition
with:
cond: ${{ steps.changed-files-specific.outputs.any_changed == 'true' }}
if_true: "--keywords=-RedundantVersion"
if_false: "--net --user-agent 'Mozilla/5.0' --timeout 15 --keywords=-RedundantVersion"
- name: Run pkgcheck
uses: pkgcore/pkgcheck-action@v1
with:
args: ${{ steps.condition.outputs.value }} ${{ steps.changed-files.outputs.all_changed_files }}
pkgs: pkgcheck>=0.10.3 requests