Skip to content

Commit

Permalink
add CI and better badges
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy committed Sep 24, 2023
1 parent f42cf19 commit a875b55
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [master]
pull_request:
branches: [master]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "test"
test:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '12'
- name: install pnpm
uses: pnpm/action-setup@v2
with:
version: 8
- run: pnpm install
- run: pnpm test:coverage
- run: pnpm test:report
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage.lcov
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# @tinyhttp/content-type

![Vulnerabilities](https://img.shields.io/snyk/vulnerabilities/npm/@tinyhttp/content-type.svg?style=flat-square)
[![Version](https://img.shields.io/npm/v/@tinyhttp/content-type.svg?style=flat-square)](https://npm.im/@tinyhttp/content-type)
[![Version][v-badge-url]][npm-url] [![Downloads][dl-badge-url]][npm-url] [![GitHub Workflow Status][gh-actions-img]][github-actions] [![Codecov][cov-badge-url]][cov-url]

> [`content-type`](https://github.com/jshttp/content-type) rewrite in TypeScript and ESM.
Expand Down Expand Up @@ -73,3 +72,11 @@ shown that produce the string `'image/svg+xml; charset=utf-8'`):
parameter will be lower-cased). Example: `{charset: 'utf-8'}`

Throws a `TypeError` if the object contains an invalid type or parameter names.

[v-badge-url]: https://img.shields.io/npm/v/@tinyhttp/content-type.svg?style=for-the-badge&color=FF69B4&label=&logo=npm
[npm-url]: https://www.npmjs.com/package/@tinyhttp/content-type
[cov-badge-url]: https://img.shields.io/coveralls/github/tinyhttp/@tinyhttp/content-type?style=for-the-badge&color=FF69B4
[cov-url]: https://coveralls.io/github/tinyhttp/@tinyhttp/content-type
[dl-badge-url]: https://img.shields.io/npm/dt/@tinyhttp/content-type?style=for-the-badge&color=FF69B4
[github-actions]: https://github.com/tinyhttp/@tinyhttp/content-type/actions
[gh-actions-img]: https://img.shields.io/github/actions/workflow/status/tinyhttp/@tinyhttp/content-type/main.yml?branch=master&style=for-the-badge&color=FF69B4&label=&logo=github
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"version": "0.1.2",
"repository": "https://github.com/tinyhttp/content-type.git",
"engines": {
"node": ">=12.x"
"node": ">=12.4"
},
"files": [
"dist"
Expand Down

0 comments on commit a875b55

Please sign in to comment.