forked from matterbridge-org/matterbridge
-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (81 loc) · 2.47 KB
/
development.yml
File metadata and controls
81 lines (81 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Development
on:
push:
paths-ignore:
- 'docs/**'
- 'README.md'
pull_request:
paths-ignore:
- 'docs/**'
- 'README.md'
permissions:
contents: read
pull-requests: read
jobs:
lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version: 1.24.x
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.1
# Only compare with previous commit when pushing,
# and with base branch when in PR.
only-new-issues: true
args: --build-tags=goolm
- name: golangci-lint (entire codebase)
uses: golangci/golangci-lint-action@v8
with:
version: v2.1
args: --build-tags=goolm --config=.golangci-incremental.yaml
test:
strategy:
matrix:
# Test on latest release and v1.24
go-version: [1.24.x, stable]
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v5
- name: go fmt ./... (go version ${{ matrix.go-version }})
run: test -z "$(go fmt ./...)"
- name: go test -tags goolm ./... (go version ${{ matrix.go-version }})
run: go test -tags goolm ./...
build-upload:
# Uploading artifacts only if lint/test succeeded
needs: [ "lint", "test" ]
strategy:
matrix:
arch: [amd64]
platform:
- name: linux
goos: linux
- name: windows
goos: windows
- name: mac
goos: darwin
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: stable
- name: Checkout code
uses: actions/checkout@v5
- name: Build/upload matterbridge for ${{ matrix.platform.goos }}-${{ matrix.arch }}
run: |
CGO_ENABLED=0 GOOS=${{ matrix.platform.goos }} GOARCH=${{ matrix.arch }} go build -tags goolm -ldflags "-s -X github.com/matterbridge-org/matterbridge/version.GitHash=$(git log --pretty=format:'%h' -n 1)" -o matterbridge
- name: Upload matterbridge-${{ matrix.name }}-${{ matrix.arch }}
uses: actions/upload-artifact@v4
with:
name: matterbridge-${{ matrix.platform.goos }}-${{ matrix.arch }}
path: matterbridge