|
1 | 1 | name: Development |
2 | 2 | on: [push, pull_request] |
3 | 3 | jobs: |
4 | | - lint: |
5 | | - name: golangci-lint |
| 4 | + # lint: |
| 5 | + # name: golangci-lint |
| 6 | + # runs-on: ubuntu-latest |
| 7 | + # steps: |
| 8 | + # - uses: actions/checkout@v3 |
| 9 | + # with: |
| 10 | + # fetch-depth: 20 |
| 11 | + # - name: Run golangci-lint |
| 12 | + # uses: golangci/golangci-lint-action@v3 |
| 13 | + # with: |
| 14 | + # version: latest |
| 15 | + # args: "-v --new-from-rev HEAD~5 --timeout=5m" |
| 16 | + # test-build-upload: |
| 17 | + # strategy: |
| 18 | + # matrix: |
| 19 | + # go-version: [1.22.x] |
| 20 | + # platform: [ubuntu-latest] |
| 21 | + # runs-on: ${{ matrix.platform }} |
| 22 | + # steps: |
| 23 | + # - name: Install Go |
| 24 | + # uses: actions/setup-go@v3 |
| 25 | + # with: |
| 26 | + # go-version: ${{ matrix.go-version }} |
| 27 | + # stable: false |
| 28 | + # - name: Checkout code |
| 29 | + # uses: actions/checkout@v3 |
| 30 | + # with: |
| 31 | + # fetch-depth: 0 |
| 32 | + # - name: Test |
| 33 | + # run: go test ./... -mod=vendor |
| 34 | + # - name: Build |
| 35 | + # run: | |
| 36 | + # mkdir -p output/{win,lin,arm,mac} |
| 37 | + # VERSION=$(git describe --tags) |
| 38 | + # CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -X github.com/42wim/matterbridge/version.GitHash=$(git log --pretty=format:'%h' -n 1)" -o output/lin/matterbridge-$VERSION-linux-amd64 |
| 39 | + # CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -X github.com/42wim/matterbridge/version.GitHash=$(git log --pretty=format:'%h' -n 1)" -o output/win/matterbridge-$VERSION-windows-amd64.exe |
| 40 | + # CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -X github.com/42wim/matterbridge/version.GitHash=$(git log --pretty=format:'%h' -n 1)" -o output/mac/matterbridge-$VERSION-darwin-amd64 |
| 41 | + # - name: Upload linux 64-bit |
| 42 | + # if: startsWith(matrix.go-version,'1.22') |
| 43 | + # uses: actions/upload-artifact@v3 |
| 44 | + # with: |
| 45 | + # name: matterbridge-linux-64bit |
| 46 | + # path: output/lin |
| 47 | + # - name: Upload windows 64-bit |
| 48 | + # if: startsWith(matrix.go-version,'1.22') |
| 49 | + # uses: actions/upload-artifact@v3 |
| 50 | + # with: |
| 51 | + # name: matterbridge-windows-64bit |
| 52 | + # path: output/win |
| 53 | + # - name: Upload darwin 64-bit |
| 54 | + # if: startsWith(matrix.go-version,'1.22') |
| 55 | + # uses: actions/upload-artifact@v3 |
| 56 | + # with: |
| 57 | + # name: matterbridge-darwin-64bit |
| 58 | + # path: output/mac |
| 59 | + integration: |
| 60 | + name: Integration tests |
6 | 61 | runs-on: ubuntu-latest |
7 | 62 | steps: |
8 | | - - uses: actions/checkout@v3 |
| 63 | + - uses: actions/checkout@v5 |
| 64 | + - uses: actions/setup-go@v6 |
9 | 65 | with: |
10 | | - fetch-depth: 20 |
11 | | - - name: Run golangci-lint |
12 | | - uses: golangci/golangci-lint-action@v3 |
13 | | - with: |
14 | | - version: latest |
15 | | - args: "-v --new-from-rev HEAD~5 --timeout=5m" |
16 | | - test-build-upload: |
17 | | - strategy: |
18 | | - matrix: |
19 | | - go-version: [1.22.x] |
20 | | - platform: [ubuntu-latest] |
21 | | - runs-on: ${{ matrix.platform }} |
22 | | - steps: |
23 | | - - name: Install Go |
24 | | - uses: actions/setup-go@v3 |
25 | | - with: |
26 | | - go-version: ${{ matrix.go-version }} |
27 | | - stable: false |
28 | | - - name: Checkout code |
29 | | - uses: actions/checkout@v3 |
30 | | - with: |
31 | | - fetch-depth: 0 |
32 | | - - name: Test |
33 | | - run: go test ./... -mod=vendor |
34 | | - - name: Build |
35 | | - run: | |
36 | | - mkdir -p output/{win,lin,arm,mac} |
37 | | - VERSION=$(git describe --tags) |
38 | | - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -X github.com/42wim/matterbridge/version.GitHash=$(git log --pretty=format:'%h' -n 1)" -o output/lin/matterbridge-$VERSION-linux-amd64 |
39 | | - CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags "-s -X github.com/42wim/matterbridge/version.GitHash=$(git log --pretty=format:'%h' -n 1)" -o output/win/matterbridge-$VERSION-windows-amd64.exe |
40 | | - CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags "-s -X github.com/42wim/matterbridge/version.GitHash=$(git log --pretty=format:'%h' -n 1)" -o output/mac/matterbridge-$VERSION-darwin-amd64 |
41 | | - - name: Upload linux 64-bit |
42 | | - if: startsWith(matrix.go-version,'1.22') |
43 | | - uses: actions/upload-artifact@v3 |
44 | | - with: |
45 | | - name: matterbridge-linux-64bit |
46 | | - path: output/lin |
47 | | - - name: Upload windows 64-bit |
48 | | - if: startsWith(matrix.go-version,'1.22') |
49 | | - uses: actions/upload-artifact@v3 |
50 | | - with: |
51 | | - name: matterbridge-windows-64bit |
52 | | - path: output/win |
53 | | - - name: Upload darwin 64-bit |
54 | | - if: startsWith(matrix.go-version,'1.22') |
55 | | - uses: actions/upload-artifact@v3 |
56 | | - with: |
57 | | - name: matterbridge-darwin-64bit |
58 | | - path: output/mac |
| 66 | + go-version: stable |
| 67 | + # Install prosody's latest release from upstream |
| 68 | + - run: sudo wget https://prosody.im/downloads/repos/$(lsb_release -sc)/prosody.sources -O/etc/apt/sources.list.d/prosody.sources |
| 69 | + - run: sudo apt update |
| 70 | + - run: sudo apt install -y mercurial lua5.4 |
| 71 | + - run: sudo update-alternatives --set lua-interpreter /usr/bin/lua5.4 |
| 72 | + - run: sudo apt install -y prosody |
| 73 | + # Setup prosody community modules |
| 74 | + - run: hg clone https://hg.prosody.im/prosody-modules/ prosody-modules |
| 75 | + # Copy mod_auth_any to global prosody modules |
| 76 | + - run: sudo cp -R prosody-modules/mod_auth_any /usr/lib/prosody/modules/ |
| 77 | + # Only one test is run for now |
| 78 | + - run: ./tests/test.sh xmpp outgoing-message |
| 79 | + # Upload logs when it failed |
| 80 | + - run: cat tests/xmpp/setup.log |
| 81 | + if: ${{ failure() }} |
| 82 | + - run: cat tests/xmpp/matterbridge.log |
| 83 | + if: ${{ failure() }} |
| 84 | + - run: cat tests/xmpp/xmpp.log |
| 85 | + if: ${{ failure() }} |
| 86 | + - run: cat tests/xmpp/api.log |
| 87 | + if: ${{ failure() }} |
0 commit comments