2021-05-15 12:44:35 +02:00
|
|
|
name: golangci-lint
|
2022-02-01 11:53:24 +01:00
|
|
|
on: [pull_request]
|
2023-10-07 21:45:46 +02:00
|
|
|
|
2024-01-08 12:25:35 +01:00
|
|
|
permissions:
|
2023-10-07 21:45:46 +02:00
|
|
|
contents: read
|
|
|
|
pull-requests: read
|
|
|
|
|
2023-04-13 17:00:01 +02:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.actor_id }}
|
|
|
|
cancel-in-progress: true
|
2023-10-07 21:45:46 +02:00
|
|
|
|
2021-05-15 12:44:35 +02:00
|
|
|
jobs:
|
2023-11-07 13:37:57 +01:00
|
|
|
codespell:
|
|
|
|
name: codespell
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code
|
2024-09-11 21:49:05 +02:00
|
|
|
uses: actions/checkout@v4
|
2023-11-07 13:37:57 +01:00
|
|
|
- name: codespell
|
|
|
|
uses: codespell-project/actions-codespell@v2
|
|
|
|
with:
|
2024-04-23 19:23:43 +02:00
|
|
|
ignore_words_list: erro,clienta,hastable,
|
2023-11-07 13:37:57 +01:00
|
|
|
skip: go.mod,go.sum
|
|
|
|
only_warn: 1
|
2021-05-15 12:44:35 +02:00
|
|
|
golangci:
|
2023-10-07 21:45:46 +02:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os: [macos-latest, windows-latest, ubuntu-latest]
|
2021-05-15 12:44:35 +02:00
|
|
|
name: lint
|
2023-10-07 21:45:46 +02:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
timeout-minutes: 15
|
2021-05-15 12:44:35 +02:00
|
|
|
steps:
|
2023-09-04 17:03:44 +02:00
|
|
|
- name: Checkout code
|
2024-09-11 21:49:05 +02:00
|
|
|
uses: actions/checkout@v4
|
2024-04-15 14:15:46 +02:00
|
|
|
- name: Check for duplicate constants
|
|
|
|
if: matrix.os == 'ubuntu-latest'
|
|
|
|
run: |
|
|
|
|
! awk '/const \(/,/)/{print $0}' management/server/activity/codes.go | grep -o '= [0-9]*' | sort | uniq -d | grep .
|
2022-08-18 18:22:15 +02:00
|
|
|
- name: Install Go
|
2024-09-11 21:49:05 +02:00
|
|
|
uses: actions/setup-go@v5
|
2022-08-18 18:22:15 +02:00
|
|
|
with:
|
2024-09-12 13:46:28 +02:00
|
|
|
go-version: "1.23.x"
|
2023-10-07 21:45:46 +02:00
|
|
|
cache: false
|
2022-03-20 17:36:35 +01:00
|
|
|
- name: Install dependencies
|
2023-10-07 21:45:46 +02:00
|
|
|
if: matrix.os == 'ubuntu-latest'
|
2024-04-08 18:56:52 +02:00
|
|
|
run: sudo apt update && sudo apt install -y -q libgtk-3-dev libayatana-appindicator3-dev libgl1-mesa-dev xorg-dev libpcap-dev
|
2021-05-15 12:44:35 +02:00
|
|
|
- name: golangci-lint
|
2023-10-07 21:45:46 +02:00
|
|
|
uses: golangci/golangci-lint-action@v3
|
|
|
|
with:
|
|
|
|
version: latest
|
2024-09-11 21:49:05 +02:00
|
|
|
args: --timeout=12m
|