|
| 1 | +on: |
| 2 | + pull_request: |
| 3 | + push: |
| 4 | + branches: [main] |
| 5 | + |
| 6 | +jobs: |
| 7 | + pytest: |
| 8 | + runs-on: ubuntu-latest |
| 9 | + steps: |
| 10 | + - |
| 11 | + name: Checkout |
| 12 | + uses: actions/checkout@v2 |
| 13 | + - |
| 14 | + name: Build Docker image |
| 15 | + run: docker build --pull --rm -f "appu/Dockerfile" -t appu appu/. |
| 16 | + - |
| 17 | + name: Run tests in Docker container |
| 18 | + run: docker run --rm appu /bin/sh -c 'pip install -r dev-requirements.txt; python -m pytest' |
| 19 | + test: |
| 20 | + runs-on: ubuntu-latest |
| 21 | + steps: |
| 22 | + - |
| 23 | + name: Checkout |
| 24 | + uses: actions/checkout@v2 |
| 25 | + - |
| 26 | + name: Install Go |
| 27 | + uses: actions/setup-go@v2 |
| 28 | + with: |
| 29 | + go-version: '^1.16' |
| 30 | + - |
| 31 | + name: Tidy dependencies to local |
| 32 | + run : | |
| 33 | + go mod tidy |
| 34 | + - |
| 35 | + name: Run tests |
| 36 | + run: | |
| 37 | + go test -v ./... -race -covermode=atomic |
| 38 | + check-formatting: |
| 39 | + runs-on: ubuntu-latest |
| 40 | + steps: |
| 41 | + - |
| 42 | + name: Checkout |
| 43 | + uses: actions/checkout@v2 |
| 44 | + - |
| 45 | + name: Check formatting |
| 46 | + run: | |
| 47 | + gofmt -s -e -d -l . | tee /tmp/gofmt.output && [ $(cat /tmp/gofmt.output | wc -l) -eq 0 ] |
| 48 | + check-smells: |
| 49 | + runs-on: ubuntu-latest |
| 50 | + steps: |
| 51 | + - |
| 52 | + name: Checkout |
| 53 | + uses: actions/checkout@v2 |
| 54 | + - |
| 55 | + name: Install Go |
| 56 | + uses: actions/setup-go@v2 |
| 57 | + with: |
| 58 | + go-version: '^1.16' |
| 59 | + - |
| 60 | + name: Tidy dependencies to local |
| 61 | + run : | |
| 62 | + go mod tidy |
| 63 | + - |
| 64 | + name: Check code smells |
| 65 | + run: | |
| 66 | + go vet ./... |
| 67 | + check-complexity: |
| 68 | + runs-on: ubuntu-latest |
| 69 | + steps: |
| 70 | + - |
| 71 | + name: Checkout |
| 72 | + uses: actions/checkout@v2 |
| 73 | + - |
| 74 | + name: Install Go |
| 75 | + uses: actions/setup-go@v2 |
| 76 | + with: |
| 77 | + go-version: '^1.16' |
| 78 | + - |
| 79 | + name: Install gocyclo |
| 80 | + run: | |
| 81 | + go install github.com/fzipp/gocyclo/cmd/gocyclo@latest |
| 82 | + - |
| 83 | + name: Check cyclomatic complexity |
| 84 | + run: | |
| 85 | + gocyclo -over 15 . |
| 86 | + check-style: |
| 87 | + runs-on: ubuntu-latest |
| 88 | + steps: |
| 89 | + - |
| 90 | + name: Checkout |
| 91 | + uses: actions/checkout@v2 |
| 92 | + - |
| 93 | + name: Install Go |
| 94 | + uses: actions/setup-go@v2 |
| 95 | + with: |
| 96 | + go-version: '^1.16' |
| 97 | + - |
| 98 | + name: Install golint |
| 99 | + run: | |
| 100 | + go install golang.org/x/lint/golint@latest |
| 101 | + - |
| 102 | + name: Check Style |
| 103 | + run: | |
| 104 | + golint ./... |
| 105 | + check-ineffectual-assignments: |
| 106 | + runs-on: ubuntu-latest |
| 107 | + steps: |
| 108 | + - |
| 109 | + name: Checkout |
| 110 | + uses: actions/checkout@v2 |
| 111 | + - |
| 112 | + name: Install Go |
| 113 | + uses: actions/setup-go@v2 |
| 114 | + with: |
| 115 | + go-version: '^1.16' |
| 116 | + - |
| 117 | + name: Install ineffassign |
| 118 | + run: | |
| 119 | + go install github.com/gordonklaus/ineffassign@latest |
| 120 | + - |
| 121 | + name: Tidy dependencies to local |
| 122 | + run : | |
| 123 | + go mod tidy |
| 124 | + - |
| 125 | + name: Check ineffectual assignments |
| 126 | + run: | |
| 127 | + ineffassign ./... |
| 128 | + check-spelling: |
| 129 | + runs-on: ubuntu-latest |
| 130 | + steps: |
| 131 | + - |
| 132 | + name: Checkout |
| 133 | + uses: actions/checkout@v2 |
| 134 | + - |
| 135 | + name: Install Go |
| 136 | + uses: actions/setup-go@v2 |
| 137 | + with: |
| 138 | + go-version: '^1.16' |
| 139 | + - |
| 140 | + name: Install spellchecker |
| 141 | + run: | |
| 142 | + go install github.com/client9/misspell/cmd/misspell@latest |
| 143 | + - |
| 144 | + name: Check spelling |
| 145 | + run: | |
| 146 | + misspell -error . |
| 147 | + staticcheck: |
| 148 | + runs-on: ubuntu-latest |
| 149 | + steps: |
| 150 | + - |
| 151 | + name: Checkout |
| 152 | + uses: actions/checkout@v2 |
| 153 | + - |
| 154 | + name: Install Go |
| 155 | + uses: actions/setup-go@v2 |
| 156 | + with: |
| 157 | + go-version: '^1.16' |
| 158 | + - |
| 159 | + name: Install staticcheck |
| 160 | + run: | |
| 161 | + go get -u honnef.co/go/tools/cmd/staticcheck@latest |
| 162 | + - |
| 163 | + name: Download dependencies to local |
| 164 | + run : | |
| 165 | + go mod download |
| 166 | + - |
| 167 | + name: Run staticcheck |
| 168 | + run: | |
| 169 | + staticcheck ./... |
| 170 | + check-license: |
| 171 | + runs-on: ubuntu-latest |
| 172 | + steps: |
| 173 | + - |
| 174 | + name: Checkout |
| 175 | + uses: actions/checkout@v2 |
| 176 | + - |
| 177 | + name: Check license file is present |
| 178 | + run: | |
| 179 | + find . -name LICENSE.md |
0 commit comments