Skip to content

Commit

Permalink
chore: add code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Neil Hemming committed Jul 16, 2021
1 parent 5739fdc commit 84015d4
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 14 deletions.
57 changes: 46 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ Rocket powered task runner to assist delivering ci build missions

## Status

![Status](https://img.shields.io/badge/Status-ALPHA-red?style=for-the-badge)
[![Build Status](https://img.shields.io/circleci/build/gh/nehemming/cirocket/master?style=for-the-badge)](https://github.com/nehemming/cirocket)
[![Release](https://img.shields.io/github/v/release/nehemming/cirocket.svg?style=for-the-badge)](https://github.com/nehemming/cirocket/releases/latest)
[![Coveralls](https://img.shields.io/coveralls/github/nehemming/cirocket?style=for-the-badge)](https://coveralls.io/github/nehemming/cirocket)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=for-the-badge)](/LICENSE)
[![GoReportCard](https://goreportcard.com/badge/github.com/nehemming/cirocket?test=0&style=for-the-badge)](https://goreportcard.com/report/github.com/nehemming/cirocket)
[![Go Doc](https://img.shields.io/badge/godoc-reference-blue.svg?style=for-the-badge)](http://godoc.org/github.com/goreleaser/goreleaser)
Expand All @@ -14,29 +16,42 @@ Rocket powered task runner to assist delivering ci build missions
[![Uses: GoReleaser](https://img.shields.io/badge/uses-goreleaser-green.svg?style=for-the-badge)](https://github.com/goreleaser)


>This project is in its early alpha MVP stage. It may be subject to change or redesign, but the hope is not to break any existing scripts using the tool.
>
>Documentation is limited. Current sources include this README and the sample config file generated by `cirocket init`
>
>If you find and problem or want to contribute please see the contribution section below.
This project is in its early alpha MVP stage. It may be subject to change or redesign, but the hope is not to break any existing scripts using the tool.

Documentation is limited. Current sources include this README and the sample config file generated by `cirocket init`
## Installation

If you find and problem or want to contribute please see the contribution section below.
The application can be installed via:

## Installation
* Pre-build [release binaries](https://github.com/nehemming/cirocket/releases)
* Homebrew
* As a [docker image](#docker)
* Using the golang tool chain
* From source by cloning this repository

To install either clone the repository or use the go tool chain to install.
### Homebrew

```sh
git clone https://github.com/nehemming/cirocket.git
cd cirocket
go install

brew install nehemming/tap/cirocket
```
or

### Go tool chain

```sh
go install github.com/nehemming/cirocket@latest
```

### From source code

```sh
git clone https://github.com/nehemming/cirocket.git
cd cirocket
go install

```
# Basic usage

`cirocket` is a simple task runner application that uses a configuration file to specify the tasks.
Expand All @@ -59,6 +74,26 @@ cirocket launch

Different mission files can be specified by adding to either command the `--config <filename>` flag.

## <a name="docker"></a>Docker

CI Rocket a basic docker image available in [packages](https://github.com/nehemming/cirocket/pkgs/container/cirocket).


To use the image, either pull it or include it in Dockerfile FROM statement.

```sh
docker pull ghcr.io/nehemming/cirocket:latest
```

The tool is best used with a mounted volume pointing at your project.

```
docker run --rm -ti -v /host/project:/project cirocket --dir /project init
```

>TIP: The `--dir` flag switches to the supplied directory before running the tool.

## Contributing

We would welcome contributions to this project. Please read our [CONTRIBUTION](https://github.com/nehemming/cirocket/blob/master/CONTRIBUTING.md) file for further details on how you can participate or report any issues.
Expand Down
6 changes: 3 additions & 3 deletions build/goreleaser.ytpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ builds:
flags:
- -trimpath
ldflags:
- '"-s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }} -X main.date={{ .CommitDate }} -X main.builtBy=[[ .builtBy ]]"'
# hooks:
# post: upx {{ .Path }}
- '-s -w -X main.version={{ .Version }} -X main.commit={{ .Commit }} -X main.date={{ .CommitDate }} -X main.builtBy=[[ .builtBy ]]'
hooks:
post: upx {{ .Path }}

[[if .includeBrews]]
brews:
Expand Down
19 changes: 19 additions & 0 deletions build/stdbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,16 @@ sequences:
- tag_display
- cleanup

- coverage:
- initialise
- validate
- coverage
- cleanup

- cirelease:
- initialise
- validate
- coverage
- credits
- release
- tag_display
Expand Down Expand Up @@ -99,6 +106,18 @@ stages:
input: '{{ .artifactsDir }}/list.tmp'
logStdOut: true

- name: coverage
tasks:
- name: clear cache
type: run
command: 'go clean -testcache'
- name: run coverage
type: run
command: 'go test -v -covermode=count -coverprofile={{ .artifactsDir }}/coverage.out ./...'
- name: publish
type: run
command: 'goveralls -coverprofile={{ .artifactsDir }}/coverage.out -repotoken $COVERALLS_REPO_TOKEN'

# credits updates the credits document using the mod list
- name: credits
tasks:
Expand Down

0 comments on commit 84015d4

Please sign in to comment.