Files
unpoller/.github/workflows/build.yml
brngates98 8d3d983844 ci: checkout unifi discover-flag when go.mod has replace => ../unifi
So Build (test + lint) passes on PRs that depend on unifi with DiscoverEndpoints.
2026-01-30 20:19:05 -05:00

65 lines
1.7 KiB
YAML

name: Build
on:
- pull_request
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
test:
strategy:
matrix:
go: ["stable"]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Checkout unifi (when go.mod replace => ../unifi)
run: |
if grep -q 'replace github.com/unpoller/unifi/v5 => ../unifi' go.mod; then
git clone --depth 1 https://github.com/brngates98/unifi.git ../unifi -b discover-flag
fi
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...
lint:
strategy:
matrix:
go: ["stable"]
os: [ubuntu-latest]
name: lint
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Checkout unifi (when go.mod replace => ../unifi)
run: |
if grep -q 'replace github.com/unpoller/unifi/v5 => ../unifi' go.mod; then
git clone --depth 1 https://github.com/brngates98/unifi.git ../unifi -b discover-flag
fi
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v2.6