Skip to content

chore: lint golang code on pre-commit #365

chore: lint golang code on pre-commit

chore: lint golang code on pre-commit #365

name: Quality assurance
on:
- push
- workflow_dispatch
env:
GO_VERSION: '1.22.2'
PNPM_VERSION: '9.0.4'
WAILS_VERSION: '2.8.1'
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: go.sum
- uses: pnpm/action-setup@v3
with:
version: ${{ env.PNPM_VERSION }}
- name: Setup Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@v${WAILS_VERSION}
- name: Install C/C++ deps
run: sudo apt install libudev-dev -y
- name: Install ui deps
run: |
cd ui
pnpm install --frozen-lockfile
cd ../..
- name: Create dummy dist dir
run: |
mkdir -p ui/dist
echo "." > ui/dist/.gitkeep
- name: Install go deps
run: go mod tidy
- name: Generate Wails JS bindings
run: wails generate module
- name: Lint with golangci-lint
uses: golangci/golangci-lint-action@v4
with:
args: --config=./.golangci.yaml
skip-cache: true
- name: Lint with revive
uses: docker://morphy/revive-action:v2
with:
config: revive.toml
path: "./..."
- name: Lint ui scripts
run: |
cd ui
pnpm lint:scripts
- name: Lint ui styles
run: |
cd ui
pnpm lint:styles
- name: Test ui
run: |
cd ui
pnpm test