Skip to content

Commit 519d87a

Browse files
authored
Run tests on drone.io (#247)
* 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 * stop using Travis
1 parent 843e3c3 commit 519d87a

File tree

4 files changed

+66
-37
lines changed

4 files changed

+66
-37
lines changed

Diff for: .drone.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
kind: pipeline
2+
name: default
3+
4+
steps:
5+
- name: lint
6+
image: arduino/arduino-cli:drone-0.2.0
7+
commands:
8+
# Check if the Go code is properly formatted and run the linter
9+
- task check
10+
# Ensure protobufs compile
11+
- task protoc
12+
13+
- name: build
14+
image: arduino/arduino-cli:drone-0.2.0
15+
commands:
16+
- task build
17+
18+
- name: test
19+
image: arduino/arduino-cli:drone-0.2.0
20+
commands:
21+
- task test
22+
- task test-legacy
23+
24+
# Contrary to other CI platforms, uploading reports to Codecov requires Drone to provide a token.
25+
# To avoid exposing the Codecov token to external PRs, we only upload coverage when we merge on
26+
# `master`.
27+
- name: coverage
28+
image: arduino/arduino-cli:drone-0.2.0
29+
environment:
30+
CODECOV_TOKEN:
31+
from_secret: codecov_token
32+
commands:
33+
- codecov -cF unit -f coverage_unit.txt -t $CODECOV_TOKEN
34+
- codecov -cF integ -f coverage_integ.txt -t $CODECOV_TOKEN
35+
when:
36+
branch:
37+
- master
38+
event:
39+
- push

Diff for: .travis.yml

-34
This file was deleted.

Diff for: Dockerfiles/CI/Dockerfile

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM golang:1.12
2+
3+
RUN apt-get update && apt-get install -y --no-install-recommends \
4+
bzip2 \
5+
unzip \
6+
&& rm -rf /var/lib/apt/lists/*
7+
8+
ENV PROTOBUF_VER 3.8.0
9+
10+
# NOTE: most of the following assume WORDKIR is '/'
11+
RUN set -ex \
12+
# Task executor, will be installed in /bin
13+
&& curl -sL https://taskfile.dev/install.sh | sh \
14+
# Codecov uploader
15+
&& curl -o /bin/codecov -LO https://codecov.io/bash && chmod +x /bin/codecov \
16+
# Go runtime dependencies
17+
&& go get github.com/golangci/govet \
18+
&& go get golang.org/x/lint/golint \
19+
# Protobuf tooling
20+
&& go get github.com/golang/protobuf/protoc-gen-go \
21+
&& mkdir protobuf && cd protobuf \
22+
&& curl -LO https://github.com/google/protobuf/releases/download/v$PROTOBUF_VER/protoc-$PROTOBUF_VER-linux-x86_64.zip \
23+
&& unzip protoc-$PROTOBUF_VER-linux-x86_64.zip && cp ./bin/* /bin/ \
24+
&& cd .. && rm -rf protobuf

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
[![Build Status](https://travis-ci.org/arduino/arduino-cli.svg?branch=master)](https://travis-ci.org/arduino/arduino-cli)
2-
31
# arduino-cli
42

3+
[![Build Status](https://cloud.drone.io/api/badges/arduino/arduino-cli/status.svg)](https://cloud.drone.io/arduino/arduino-cli)
4+
55
`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.
66

77
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:
355355
* test-unit-race: Run unit tests only with race condition detection
356356
```
357357

358-
For Example to launch unit tests only run: `task test-unit`
358+
For Example to launch unit tests only run: `task test-unit`

0 commit comments

Comments
 (0)