From 5147ae49b1ebdf8db45e52f7dc288d48b3b057ef Mon Sep 17 00:00:00 2001 From: Massimiliano Pippi Date: Tue, 11 Jun 2019 10:47:46 +0200 Subject: [PATCH 1/2] Run tests on drone.io added dockerfile use custom image install task inside container install bzip2 install unzip install test tools restore coverage collection add codecov to the image coverage only on master --- .drone.yml | 39 +++++++++++++++++++++++++++++++++++++++ Dockerfiles/CI/Dockerfile | 24 ++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfiles/CI/Dockerfile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 00000000000..24a8305ae87 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,39 @@ +kind: pipeline +name: default + +steps: +- name: lint + image: arduino/arduino-cli:drone-0.2.0 + commands: + # Check if the Go code is properly formatted and run the linter + - task check + # Ensure protobufs compile + - task protoc + +- name: build + image: arduino/arduino-cli:drone-0.2.0 + commands: + - task build + +- name: test + image: arduino/arduino-cli:drone-0.2.0 + commands: + - task test + - task test-legacy + +# Contrary to other CI platforms, uploading reports to Codecov requires Drone to provide a token. +# To avoid exposing the Codecov token to external PRs, we only upload coverage when we merge on +# `master`. +- name: coverage + image: arduino/arduino-cli:drone-0.2.0 + environment: + CODECOV_TOKEN: + from_secret: codecov_token + commands: + - codecov -cF unit -f coverage_unit.txt -t $CODECOV_TOKEN + - codecov -cF integ -f coverage_integ.txt -t $CODECOV_TOKEN + when: + branch: + - master + event: + - push diff --git a/Dockerfiles/CI/Dockerfile b/Dockerfiles/CI/Dockerfile new file mode 100644 index 00000000000..fd4b9cf4002 --- /dev/null +++ b/Dockerfiles/CI/Dockerfile @@ -0,0 +1,24 @@ +FROM golang:1.12 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + bzip2 \ + unzip \ + && rm -rf /var/lib/apt/lists/* + +ENV PROTOBUF_VER 3.8.0 + +# NOTE: most of the following assume WORDKIR is '/' +RUN set -ex \ + # Task executor, will be installed in /bin + && curl -sL https://taskfile.dev/install.sh | sh \ + # Codecov uploader + && curl -o /bin/codecov -LO https://codecov.io/bash && chmod +x /bin/codecov \ + # Go runtime dependencies + && go get github.com/golangci/govet \ + && go get golang.org/x/lint/golint \ + # Protobuf tooling + && go get github.com/golang/protobuf/protoc-gen-go \ + && mkdir protobuf && cd protobuf \ + && curl -LO https://github.com/google/protobuf/releases/download/v$PROTOBUF_VER/protoc-$PROTOBUF_VER-linux-x86_64.zip \ + && unzip protoc-$PROTOBUF_VER-linux-x86_64.zip && cp ./bin/* /bin/ \ + && cd .. && rm -rf protobuf From c49f8d9e93b2cadf91ff0c93988c2eec757c6b81 Mon Sep 17 00:00:00 2001 From: Massimiliano Pippi Date: Tue, 2 Jul 2019 11:31:14 +0200 Subject: [PATCH 2/2] stop using Travis --- .travis.yml | 34 ---------------------------------- README.md | 6 +++--- 2 files changed, 3 insertions(+), 37 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f4203269158..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,34 +0,0 @@ -language: go - -go: - - 1.12.x - -env: - - GO111MODULE=on PATH=$HOME/protobuf/bin:$PATH - -# Anything in before_script that returns a nonzero exit code will flunk the -# build and immediately stop. It's sorta like having set -e enabled in bash. -# Make sure golangci-lint is vendored. -install: - - curl -sL https://taskfile.dev/install.sh | sh - - go get github.com/golangci/govet - - go get golang.org/x/lint/golint - - go get -u github.com/golang/protobuf/protoc-gen-go - - | - mkdir -p $HOME/protobuf && pushd $HOME/protobuf && - curl -LO 'https://github.com/google/protobuf/releases/download/v3.8.0/protoc-3.8.0-linux-x86_64.zip' && - unzip protoc-3.8.0-linux-x86_64.zip && - popd - -script: - # Check if the code is formatted and run linter - - ./bin/task check - # Build and test - - ./bin/task protoc - - ./bin/task build - - ./bin/task test - - ./bin/task test-legacy - -after_success: - - bash <(curl -s https://codecov.io/bash) -cF unit -f '*_unit.txt' - - bash <(curl -s https://codecov.io/bash) -cF integ -f '*_integ.txt' diff --git a/README.md b/README.md index fcced6ed40e..5a9ee859c3b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -[![Build Status](https://travis-ci.org/arduino/arduino-cli.svg?branch=master)](https://travis-ci.org/arduino/arduino-cli) - # arduino-cli +[![Build Status](https://cloud.drone.io/api/badges/arduino/arduino-cli/status.svg)](https://cloud.drone.io/arduino/arduino-cli) + `arduino-cli` is an all-in-one solution that provides builder, boards/library manager, uploader, discovery and many other tools needed to use any Arduino compatible board and platforms. This software is currently in alpha state: new features will be added and some may be changed. @@ -355,4 +355,4 @@ Currently Unit and Integration test are available for launch in 2 ways: * test-unit-race: Run unit tests only with race condition detection ``` -For Example to launch unit tests only run: `task test-unit` \ No newline at end of file +For Example to launch unit tests only run: `task test-unit` \ No newline at end of file