~samwhited/xmpp

ref: 467e8c4a0b977d765eadf64f02ebb5edee0ce805 xmpp/.builds/validate.yml -rw-r--r-- 1.7 KiB
467e8c4aSam Whited component: add integration tests 1 year, 5 months ago
                                                                                
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
image: alpine/edge
packages:
  - go
  - git
sources:
  - https://git.sr.ht/~samwhited/xmpp
environment:
  GO111MODULE: "on"
tasks:
  - dco: |
      git version
      cd xmpp/
      function on_err {
        cat <<EOF
      Failed to sign the Developer Certificate of Origin (DCO)!
      Please read the file "DCO" and then, if you agree, sign each of your commits
      using:

          git commit -s

      Or quickly sign the previous commit with:

          git commit --amend -s --no-edit
      EOF
      }
      trap on_err ERR

      # Check that all commits that aren't in master are signed off by the same
      # committer (taken from the HEAD commit).
      [[ ! "$(git log --invert-grep --grep="Signed-off-by: $(git show -s --pretty="%cn <%ce>" HEAD)" origin/master..)" ]]
  - setup: |
      go version
      go env

      go get -u golang.org/x/lint/golint
      go get -u github.com/securego/gosec/cmd/gosec
      go get -u git.sr.ht/~samwhited/checkdoc
      go get -u mellium.im/checkmd

      echo 'export PATH=$(go env GOPATH)/bin:$PATH' >> ~/.buildenv
  - lint: |
      cd xmpp/
      go vet ./...
      gofmt -s -l . && [ -z "$(gofmt -s -l .)" ]

      golint -set_exit_status ./...
      gosec ./...

      checkdoc -fileheader.pattern='-' ./... <<EOF
      Copyright \d\d\d\d The Mellium Contributors\.
      Use of this source code is governed by the BSD 2-clause
      license that can be found in the LICENSE file\.
      EOF

      checkmd .
  - validate: |
      cd xmpp/
      go mod tidy
      git diff --exit-code -- go.mod go.sum
      cd examples/
      for d in ./*/; do
        pushd $d
        go mod tidy
        git diff --exit-code -- go.mod go.sum
        popd
      done