mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2025-12-06 05:25:41 -05:00
61 lines
1.2 KiB
YAML
61 lines
1.2 KiB
YAML
name: Go CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- "**"
|
|
paths:
|
|
- "core/**"
|
|
- ".github/workflows/go-ci.yml"
|
|
pull_request:
|
|
branches: [master, main]
|
|
paths:
|
|
- "core/**"
|
|
- ".github/workflows/go-ci.yml"
|
|
|
|
concurrency:
|
|
group: go-ci-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
lint-and-test:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
working-directory: core
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: ./core/go.mod
|
|
|
|
- name: Format check
|
|
run: |
|
|
if [ "$(gofmt -s -l . | wc -l)" -gt 0 ]; then
|
|
echo "The following files are not formatted:"
|
|
gofmt -s -l .
|
|
exit 1
|
|
fi
|
|
|
|
- name: Run golangci-lint
|
|
uses: golangci/golangci-lint-action@v9
|
|
with:
|
|
version: v2.6
|
|
working-directory: core
|
|
|
|
- name: Test
|
|
run: go test -v ./...
|
|
|
|
- name: Build dms
|
|
run: go build -v ./cmd/dms
|
|
|
|
- name: Build dms (distropkg)
|
|
run: go build -v -tags distro_binary ./cmd/dms
|
|
|
|
- name: Build dankinstall
|
|
run: go build -v ./cmd/dankinstall
|