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