kind: pipeline
name: default

steps:
- name: test
  image: golang
  environment:
    GO111MODULE: on
    ARN_ROOT: /notify.moe
  commands:
  - go version
  - go get ./...
  - go build ./...
  - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
  - golangci-lint run --enable dupl
  - git clone --depth=1 https://github.com/animenotifier/notify.moe $ARN_ROOT
  - git clone --depth=1 https://github.com/animenotifier/database ~/.aero/db/arn
  - go test -v -race -coverprofile=autocorrect.txt ./autocorrect
  - go test -v -race -coverprofile=stringutils.txt ./stringutils
  - go test -v -race -coverprofile=validate.txt ./validate
  - go test -v -race -coverprofile=root.txt .

- name: coverage
  image: plugins/codecov
  settings:
    token:
      from_secret: codecov-token
    files:
      - root.txt
      - autocorrect.txt
      - stringutils.txt
      - validate.txt

- name: discord
  image: appleboy/drone-discord
  when:
    status:
    - failure
  settings:
    webhook_id:
      from_secret: discord-id
    webhook_token:
      from_secret: discord-token

kind: pipeline
name: default

steps:
- name: test
  image: golang
  environment:
    GO111MODULE: on
    ARN_ROOT: /notify.moe
  commands:
  - go version
  - go get ./...
  - go build ./...
  - curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0
  - golangci-lint run
  - git clone --depth=1 https://github.com/animenotifier/notify.moe $ARN_ROOT
  - git clone --depth=1 https://github.com/animenotifier/database ~/.aero/db/arn
  - go test -v -race -coverprofile=autocorrect.txt ./autocorrect
  - go test -v -race -coverprofile=stringutils.txt ./stringutils
  - go test -v -race -coverprofile=validate.txt ./validate
  - go test -v -race -coverprofile=root.txt .

- name: coverage
  image: plugins/codecov
  settings:
    token:
      from_secret: codecov-token
    files:
      - root.txt
      - autocorrect.txt
      - stringutils.txt
      - validate.txt

- name: discord
  image: appleboy/drone-discord
  when:
    status:
    - failure
  settings:
    webhook_id:
      from_secret: discord-id
    webhook_token:
      from_secret: discord-token

Disable duplication checks until fixed
Disable duplication checks until fixed
