2019-12-13 10:31:10 +00:00
|
|
|
if: repo = AdguardTeam/AdGuardHome
|
2018-08-30 16:16:37 +01:00
|
|
|
language: go
|
|
|
|
sudo: false
|
2019-01-29 12:11:11 +00:00
|
|
|
|
2018-08-30 16:16:37 +01:00
|
|
|
go:
|
2020-04-05 16:21:26 +01:00
|
|
|
- 1.14.x
|
2018-08-30 17:06:08 +01:00
|
|
|
os:
|
|
|
|
- linux
|
|
|
|
- osx
|
2020-04-13 22:04:38 +01:00
|
|
|
- windows
|
2018-08-30 17:06:08 +01:00
|
|
|
|
2019-01-04 18:00:06 +00:00
|
|
|
before_install:
|
2020-04-13 22:04:38 +01:00
|
|
|
- |-
|
|
|
|
case $TRAVIS_OS_NAME in
|
|
|
|
linux | osx)
|
|
|
|
nvm install node
|
|
|
|
npm install -g npm
|
|
|
|
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.23.8
|
|
|
|
;;
|
|
|
|
windows)
|
2020-04-13 22:26:44 +01:00
|
|
|
# Using NVS for managing Node.js versions on Windows
|
2020-04-13 22:30:20 +01:00
|
|
|
NVS_HOME="C:\ProgramData\nvs"
|
2020-04-13 22:26:44 +01:00
|
|
|
git clone --single-branch https://github.com/jasongin/nvs $NVS_HOME
|
|
|
|
source $NVS_HOME/nvs.sh
|
|
|
|
nvs add latest
|
|
|
|
nvs use latest
|
2020-04-13 22:04:38 +01:00
|
|
|
;;
|
|
|
|
esac
|
2019-01-04 18:00:06 +00:00
|
|
|
|
2018-09-07 14:13:03 +01:00
|
|
|
install:
|
2020-04-13 22:04:38 +01:00
|
|
|
- |-
|
|
|
|
case $TRAVIS_OS_NAME in
|
|
|
|
linux | osx)
|
2020-04-13 22:26:44 +01:00
|
|
|
node --version
|
|
|
|
npm --version
|
2020-04-13 22:04:38 +01:00
|
|
|
npm --prefix client ci
|
|
|
|
;;
|
|
|
|
windows)
|
2020-04-13 22:26:44 +01:00
|
|
|
node --version
|
|
|
|
npm --version
|
|
|
|
nvs --version
|
2020-04-13 22:04:38 +01:00
|
|
|
npm --prefix client ci
|
|
|
|
;;
|
|
|
|
esac
|
2018-09-07 14:13:03 +01:00
|
|
|
|
2019-01-29 12:11:11 +00:00
|
|
|
cache:
|
|
|
|
directories:
|
|
|
|
- $HOME/.cache/go-build
|
|
|
|
- $HOME/gopath/pkg/mod
|
|
|
|
- $HOME/Library/Caches/go-build
|
|
|
|
|
2018-08-30 16:16:37 +01:00
|
|
|
script:
|
2020-04-13 22:04:38 +01:00
|
|
|
- |-
|
|
|
|
case $TRAVIS_OS_NAME in
|
|
|
|
linux | osx)
|
|
|
|
/bin/bash ci.sh
|
|
|
|
;;
|
|
|
|
windows)
|
2020-04-15 13:24:12 +01:00
|
|
|
npm --prefix client run build-prod
|
2020-04-13 22:04:38 +01:00
|
|
|
go test -race -v -bench=. -coverprofile=coverage.txt -covermode=atomic ./...
|
|
|
|
;;
|
|
|
|
esac
|
2018-08-30 16:16:37 +01:00
|
|
|
|
2019-01-25 09:55:13 +00:00
|
|
|
after_success:
|
2020-04-13 22:04:38 +01:00
|
|
|
- |-
|
|
|
|
case $TRAVIS_OS_NAME in
|
|
|
|
linux)
|
|
|
|
bash <(curl -s https://codecov.io/bash)
|
|
|
|
;;
|
|
|
|
esac
|
2019-01-29 12:11:11 +00:00
|
|
|
|
2019-08-16 11:47:51 +01:00
|
|
|
notifications:
|
2019-08-16 14:08:56 +01:00
|
|
|
slack: performix:yXTihlSzsLFSZiqbXMNzvTSX
|
2019-08-16 11:47:51 +01:00
|
|
|
|
2019-01-29 12:11:11 +00:00
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
# Release build configuration
|
2019-12-13 10:31:10 +00:00
|
|
|
- if: repo = AdguardTeam/AdGuardHome
|
2019-01-29 12:11:11 +00:00
|
|
|
- name: release
|
|
|
|
go:
|
2020-04-05 16:21:26 +01:00
|
|
|
- 1.14.x
|
2019-01-29 12:11:11 +00:00
|
|
|
os:
|
|
|
|
- linux
|
|
|
|
|
|
|
|
script:
|
|
|
|
- node -v
|
|
|
|
- npm -v
|
|
|
|
# Prepare releases
|
2020-04-21 13:05:13 +01:00
|
|
|
- ./build_release.sh
|
2019-01-29 12:11:11 +00:00
|
|
|
- ls -l dist
|
|
|
|
|
|
|
|
deploy:
|
|
|
|
provider: releases
|
|
|
|
api_key: $GITHUB_TOKEN
|
|
|
|
file:
|
|
|
|
- dist/AdGuardHome_*
|
|
|
|
on:
|
|
|
|
repo: AdguardTeam/AdGuardHome
|
|
|
|
tags: true
|
|
|
|
draft: true
|
|
|
|
file_glob: true
|
|
|
|
skip_cleanup: true
|
|
|
|
|
2020-04-13 22:04:38 +01:00
|
|
|
# Docker build configuration
|
|
|
|
- if: repo = AdguardTeam/AdGuardHome
|
2019-01-29 12:11:11 +00:00
|
|
|
- name: docker
|
2019-12-13 10:31:10 +00:00
|
|
|
if: type != pull_request AND (branch = master OR tag IS present) AND repo = AdguardTeam/AdGuardHome
|
2019-01-29 12:11:11 +00:00
|
|
|
go:
|
2020-04-05 16:21:26 +01:00
|
|
|
- 1.14.x
|
2019-01-29 12:11:11 +00:00
|
|
|
os:
|
|
|
|
- linux
|
|
|
|
services:
|
|
|
|
- docker
|
|
|
|
before_script:
|
|
|
|
- nvm install node
|
|
|
|
- npm install -g npm
|
|
|
|
script:
|
|
|
|
- docker login -u="$DOCKER_USER" -p="$DOCKER_PASSWORD"
|
|
|
|
- ./build_docker.sh
|
|
|
|
after_script:
|
2020-04-21 14:25:29 +01:00
|
|
|
- docker images
|