Compare commits

...

9 Commits

Author SHA1 Message Date
Suzanne Soy
db0bb496d2 Handle branches and tags 2021-07-28 17:31:10 +01:00
Suzanne Soy
97cb67e184 fixed typo 2021-07-28 17:17:19 +01:00
Suzanne Soy
88b9b22511 Trying to add github service 2021-07-28 17:10:40 +01:00
Thomas Hu
50388b3607
Merge pull request #7 from fossabot/add-license-scan-badge
Add license scan report and status
2020-09-09 13:08:43 -04:00
fossabot
53db586642 Add license scan report and status
Signed off by: fossabot <badges@fossa.com>
2020-08-26 18:07:53 -05:00
promethea
a08e68f5ac Update example .gitlab-ci.yml to include necessary variables 2017-03-01 10:53:27 -06:00
promethea
e93ee24d11 Add support for Gitlab-CI 2017-03-01 10:53:27 -06:00
Georges Dupéron
68ff79258f Updated .travis.yml to build only on v6.6+, as cover now depends on that. 2017-01-07 17:27:22 -06:00
Georges Dupéron
a227aa8c8a Install cover-codecov in the example .travis.yml
I don't think `cover-codecov` comes with the main distribution, so the example .travis.yml file in the README should include the command to install it.
2017-01-07 17:27:22 -06:00
5 changed files with 97 additions and 10 deletions

View File

@ -4,11 +4,8 @@ env:
global: global:
- RACKET_DIR=~/racket - RACKET_DIR=~/racket
matrix: matrix:
- RACKET_VERSION=6.1.1 - RACKET_VERSION=6.6
- RACKET_VERSION=6.2 - RACKET_VERSION=6.7
- RACKET_VERSION=6.2.1
- RACKET_VERSION=6.3
- RACKET_VERSION=6.4
- RACKET_VERSION=HEAD - RACKET_VERSION=HEAD
matrix: matrix:

View File

@ -2,19 +2,20 @@
[![Build Status](https://travis-ci.org/codecov/codecov-racket.svg?branch=master)](https://travis-ci.org/codecov/codecov-racket) [![Build Status](https://travis-ci.org/codecov/codecov-racket.svg?branch=master)](https://travis-ci.org/codecov/codecov-racket)
[![codecov.io](https://codecov.io/github/codecov/codecov-racket/coverage.svg?branch=master)](https://codecov.io/github/codecov/codecov-racket?branch=master) [![codecov.io](https://codecov.io/github/codecov/codecov-racket/coverage.svg?branch=master)](https://codecov.io/github/codecov/codecov-racket?branch=master)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-racket.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-racket?ref=badge_shield)
Adds [Codecov](https://codecov.io/) support to [Cover](https://github.com/florence/cover). Adds [Codecov](https://codecov.io/) support to [Cover](https://github.com/florence/cover).
_Note_: [Travis CI](https://travis-ci.org/) is currently the only supported method of posting data to [Codecov](https://codecov.io/). _Note_: The currently supported methods of posting data to [Codecov](https://codecov.io/) are [Travis CI](https://travis-ci.org/) and [Gitlab CI](https://about.gitlab.com/gitlab-ci/).
## Use with TravisCI ## Use with Travis CI
First enable your repository on Travis and Codecov. First enable your repository on Travis and Codecov.
Next add `cover-codecov` to the `build-deps` of your `info.rkt`. Next add `cover-codecov` to the `build-deps` of your `info.rkt`.
Then create a `.travis.yml` in the root of your repository. Then create a `.travis.yml` in the root of your repository.
```yml ```yml
# .travis.yml # .travis.yml
langauge: c language: c
sudo: false sudo: false
env: env:
global: global:
@ -33,8 +34,49 @@ script:
- raco test $TRAVIS_BUILD_DIR # run tests. you wrote tests, right? - raco test $TRAVIS_BUILD_DIR # run tests. you wrote tests, right?
after_success: after_success:
- raco pkg install --deps search-auto cover cover-codecov
- raco cover -f codecov -d $TRAVIS_BUILD_DIR/coverage . # generate coverage information for coveralls - raco cover -f codecov -d $TRAVIS_BUILD_DIR/coverage . # generate coverage information for coveralls
``` ```
The above Travis configuration will install any project dependencies, test your project, and report coverage information to Codecov. The above Travis configuration will install any project dependencies, test your project, and report coverage information to Codecov.
For additional Travis configuration information look at [Travis Racket](https://github.com/greghendershott/travis-racket). For additional Travis configuration information look at [Travis Racket](https://github.com/greghendershott/travis-racket).
## Use with Gitlab-CI
Like with Travis, except that you should use the Gitlab format
of the CI configuration file:
```yml
image: frolvlad/alpine-glibc
variables:
RACKET_DIR: "$HOME/racket"
RACKET_VERSION: "6.8" # use the desired version of racket
before_script:
- echo "ipv6" >> /etc/modules
- apk update
- apk add git curl bash openssl sqlite-libs
- git clone https://github.com/greghendershott/travis-racket.git ~/ci-racket
- cat ~/ci-racket/install-racket.sh | bash # pipe to bash not sh!
- export PATH="$RACKET_DIR/bin:$PATH" #install-racket.sh can't set for us
- raco pkg install --auto $CI_PROJECT_DIR
stages:
- test
- cover
test:
stage: test
script:
- raco test $CI_PROJECT_DIR
cover:
stage: cover
script:
- raco pkg install --auto cover cover-codecov
- raco cover -f codecov $CI_PROJECT_DIR
```
## License
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-racket.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fcodecov-racket?ref=badge_large)

View File

@ -11,7 +11,9 @@
net/uri-codec net/uri-codec
cover/private/file-utils cover/private/file-utils
"ci-service.rkt" "ci-service.rkt"
"travis-service.rkt") "travis-service.rkt"
"gitlab-service.rkt"
"github-service.rkt")
(module+ test (module+ test
(require rackunit cover racket/runtime-path)) (require rackunit cover racket/runtime-path))
@ -73,7 +75,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define services (define services
(hash travis-ci? travis-service@)) (hash travis-ci? travis-service@
gitlab-ci? gitlab-service@
github-ci? github-service@))
(define CODECOV_HOST "codecov.io") (define CODECOV_HOST "codecov.io")

View File

@ -0,0 +1,21 @@
#lang racket/base
(provide github-service@ github-ci?)
(require "ci-service.rkt" racket/unit racket/list racket/string)
(define (github-ci?) (and (getenv "GITHUB_REPOSITORY") (getenv "CODECOV_TOKEN")))
(define-unit github-service@
(import)
(export ci-service^)
(define (query)
(define repo-slug (getenv "GITHUB_REPOSITORY"))
(list (cons 'service "custom")
(cons 'token (getenv "CODECOV_TOKEN"))
;; TODO: this won't work for tags
(cons 'branch (string-trim (getenv "GITHUB_REF") #px"refs/(heads|tags)/"))
(cons 'job (getenv "GITHUB_JOB"))
(cons 'slug (getenv "GITHUB_REPOSITORY"))
(cons 'build (getenv "GITHUB_RUN_ID"))
(cons 'commit (getenv "GITHUB_SHA")))))

View File

@ -0,0 +1,23 @@
#lang racket/base
(provide gitlab-service@ gitlab-ci?)
(require "ci-service.rkt" racket/unit racket/list racket/string)
(define (gitlab-ci?) (and (getenv "CI") (getenv "GITLAB_CI")))
(define-unit gitlab-service@
(import)
(export ci-service^)
(define (query)
(define project-url (getenv "CI_PROJECT_URL"))
(define branch (getenv "CI_BUILD_REF_NAME"))
(list (cons 'service "gitlab")
(cons 'token (getenv "CODECOV_TOKEN"))
(cons 'branch branch)
(cons 'job (getenv "CI_PIPELINE_ID"))
(cons 'slug (getenv "CI_PROJECT_PATH"))
(cons 'tag (getenv "CI_BUILD_TAG"))
(cons 'build (getenv "CI_BUILD_ID"))
(cons 'build_url (and project-url branch (format "~a/tree/~a" project-url branch)))
(cons 'commit (getenv "CI_BUILD_REF")))))