~samwhited/xmpp

ref: e8c09b3ff1c1489c21d96a0f7f8f0e8728fc095a xmpp/.builds/validate.yml -rw-r--r-- 2.3 KiB
e8c09b3fSam Whited design: fix typo in design doc template 1 year, 4 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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
  - contributors: |
      cd xmpp/
      function on_err {
        cat <<EOF
      We didn't find you in the CONTRIBUTORS file!
      Please read the file "DCO" and then, if you agree, add yourself to the
      CONTRIBUTORS file by running:

          make CONTRIBUTORS

      If you are already in the CONTRIBUTORS file, check that you comitted using
      the correct name and password and if not fix your commits or (if they've
      already been merged) add a .mailmap entry for yourself.
      For more info see https://www.git-scm.com/docs/git-check-mailmap
      EOF
      }
      trap on_err ERR

      rm -f CONTRIBUTORS && make CONTRIBUTORS
      git diff --exit-code -- CONTRIBUTORS