Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppVeyor #854

Merged
merged 17 commits into from
Sep 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 152 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
version: "{build}"

stack: node 10.16.3

environment:
matrix:
# For regular jobs, such as push, pr and etc.
- job_name: Linux
appveyor_build_worker_image: ubuntu1804
GOARCH: amd64
- job_name: MacOS
appveyor_build_worker_image: macos
GOARCH: amd64
- job_name: Windows
appveyor_build_worker_image: Visual Studio 2019
GOARCH: amd64

# For release, by pushing tag
- job_name: linux-amd64
appveyor_build_worker_image: ubuntu1804
GOARCH: amd64
- job_name: linux-arm
appveyor_build_worker_image: ubuntu1804
GOARCH: arm
- job_name: linux-arm64
appveyor_build_worker_image: ubuntu1804
GOARCH: arm64
- job_name: linux-386
appveyor_build_worker_image: ubuntu1804
GOARCH: 386
- job_name: darwin-amd64
appveyor_build_worker_image: macos
GOARCH: amd64
- job_name: windows-amd64
appveyor_build_worker_image: Visual Studio 2019
GOARCH: amd64

for:
- # Linux and MacOS
skip_tags: true
matrix:
only:
- job_name: Linux
- job_name: MacOS

install:
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.42.0
- make dep
- sh: ci_scripts/create-ip-aliases.sh
- make install-deps-ui

before_build:
- make check
- make lint-ui

build_script:
- make build
- make build-ui

- # Windows
skip_tags: true
matrix:
only:
- job_name: Windows

environment:
matrix:
- GOARCH: amd64

install:
- choco install make
- go get github.com/golangci/golangci-lint/cmd/[email protected]
- make dep
- make install-deps-ui

before_build:
- set GO111MODULE=on
- make check-windows-appveyor
- make lint-ui

build_script:
- make build
- make build-ui

- # Linux and MacOS (Release)
skip_non_tags: true
matrix:
only:
- job_name: linux-arm
- job_name: linux-arm64
- job_name: linux-amd64
- job_name: linux-386
- job_name: darwin-amd64

install:
- make dep
- ci_scripts/create-ip-aliases.sh
- export GOARM=7

build_script:
- make build

after_build:
- tar -cvzf skywire-$APPVEYOR_REPO_TAG_NAME-$APPVEYOR_JOB_NAME.tar.gz ./apps/* ./skywire-visor ./skywire-cli ./setup-node

artifacts:
- path: skywire-$(APPVEYOR_REPO_TAG_NAME)-$(APPVEYOR_JOB_NAME).tar.gz
name: deploy

deploy:
- provider: GitHub
release: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: ZrbNBE2wSfGvHzEq5GqEAUmNy7myDIl7KK05CKlZdQfieV7XdIAPXpkdHNEyZbvT
draft: true
artifact: deploy
on:
APPVEYOR_REPO_TAG: true

- # Windows (Release)
skip_non_tags: true
matrix:
only:
- job_name: windows-amd64

environment:
matrix:
- GOARCH: amd64

install:
- cmd: choco install make
- make dep

build_script:
- make build

after_build:
- sh: tar -cvzf skywire-$APPVEYOR_REPO_TAG_NAME-$APPVEYOR_JOB_NAME.tar.gz ./apps/* ./skywire-visor ./skywire-cli ./setup-node

artifacts:
- path: skywire-$(APPVEYOR_REPO_TAG_NAME)-$(APPVEYOR_JOB_NAME).tar.gz
name: deploy

deploy:
- provider: GitHub
release: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: ZrbNBE2wSfGvHzEq5GqEAUmNy7myDIl7KK05CKlZdQfieV7XdIAPXpkdHNEyZbvT
draft: true
artifact: deploy
on:
APPVEYOR_REPO_TAG: true
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ BUILD_OPTS_DEPLOY?="-ldflags=$(BUILDINFO) -w -s"

check: lint test ## Run linters and tests

check-windows-appveyor: lint-windows-appveyor test ## Run linters and tests on appveyor windows image

build: host-apps bin ## Install dependencies, build apps and binaries. `go build` with ${OPTS}

build-static: host-apps-static bin-static ## Build apps and binaries. `go build` with ${OPTS}
Expand Down Expand Up @@ -73,6 +75,9 @@ lint: ## Run linters. Use make install-linters first
${OPTS} golangci-lint run -c .golangci.yml ./...
# The govet version in golangci-lint is out of date and has spurious warnings, run it separately

lint-windows-appveyor:
C:\Users\appveyor\go\bin\golangci-lint run -c .golangci.yml ./...

lint-extra: ## Run linters with extra checks.
${OPTS} golangci-lint run --no-config --enable-all ./...
# The govet version in golangci-lint is out of date and has spurious warnings, run it separately
Expand Down
3 changes: 1 addition & 2 deletions pkg/visor/rpc_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package visor

import (
"fmt"
"net/http"
"testing"
"time"
Expand Down Expand Up @@ -103,7 +102,7 @@ func TestUptime(t *testing.T) {
err := rpc.Uptime(nil, &res)
require.NoError(t, err)

assert.Contains(t, fmt.Sprintf("%f", res), "1.0")
assert.GreaterOrEqual(t, res, 1.0)
}

// TODO(evanlinjin): These should be moved to /pkg/app/launcher
Expand Down