Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
ci(github): migrate from travis to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Jan 23, 2022
1 parent b5fe646 commit 05f4fc4
Show file tree
Hide file tree
Showing 9 changed files with 174 additions and 373 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check

on: push

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
cache: yarn
node-version: 16
- run: yarn
- run: yarn test:lint

unit_test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
cache: yarn
node-version: 16
- run: yarn
- run: yarn test:unit
- run: yarn codecov
28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Release

on: workflow_dispatch

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup
uses: actions/setup-node@v2
with:
cache: yarn
node-version: 16
- name: Install
run: yarn
- name: Build
run: yarn build
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# dumdum

[![License][img-license]][link-license]
[![NPM Version][img-npm]][link-npm]
[![Build Status][img-travis]][link-travis]
[![Code Coverage][img-coveralls]][link-coveralls]
[![License][img-license]][lnk-license]
[![NPM Package][img-npm]][lnk-npm]
[![Build Status][img-github]][lnk-github]
[![Code Coverage][img-codecov]][lnk-codecov]

Dummy data generator for local development, demos and testing purposes.

Expand Down Expand Up @@ -99,11 +99,11 @@ yarn data:generate [fr|en]...

---

[img-coveralls]: https://img.shields.io/coveralls/github/ivangabriele/dumdum/master?style=flat-square
[img-license]: https://img.shields.io/badge/License-MIT-blue?style=flat-square
[img-codecov]: https://img.shields.io/codecov/c/github/ivangabriele/dumdum/main?style=flat-square
[img-github]: https://img.shields.io/github/workflow/status/ivangabriele/dumdum/Check/main?style=flat-square
[img-license]: https://img.shields.io/github/license/ivangabriele/dumdum?style=flat-square
[img-npm]: https://img.shields.io/npm/v/dumdum?style=flat-square
[img-travis]: https://img.shields.io/travis/com/ivangabriele/dumdum/master?style=flat-square
[link-coveralls]: https://coveralls.io/github/ivangabriele/dumdum
[link-license]: https://github.com/ivangabriele/dumdum/blob/master/LICENSE
[link-npm]: https://www.npmjs.com/package/dumdum
[link-travis]: https://travis-ci.com/ivangabriele/dumdum
[lnk-codecov]: https://codecov.io/gh/ivangabriele/dumdum/branch/main
[lnk-github]: https://github.com/ivangabriele/dumdum/actions?query=branch%3Amain++
[lnk-license]: https://github.com/ivangabriele/dumdum/blob/master/LICENSE
[lnk-npm]: https://www.npmjs.com/package/dumdum
3 changes: 2 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

module.exports = {
bail: true,
collectCoverage: true,
collectCoverageFrom: ['<rootDir>/src/**/*.ts'],
moduleFileExtensions: ["ts", "tsx", "js", "jsx", "json", "node"],
roots: ["<rootDir>/src"],
testRegex: `(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$`,
transform: {
"^.+\\.tsx?$": "ts-jest"
},
Expand Down
13 changes: 3 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,19 @@
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "rollup -c && copyfiles -f ./src/index.d.ts ./dist",
"build:release": "yarn build && node ./scripts/ci/build_release.js",
"ci:generate:release_notes": "node ./scripts/ci/generate_release_notes.js",
"build": "rollup -c && cp ./src/index.d.ts ./dist/index.d.ts",
"data:generate": "node ./scripts/data/generate.js",
"test": "yarn test:lint && yarn test:unit",
"test:lint": "tslint -p ./tsconfig.json",
"test:unit": "jest --coverage",
"test:watch": "yarn test:unit --watch",
"preversion": "yarn test",
"postversion": "git push origin HEAD && git push --tags"
"test:watch": "yarn test:unit --watch"
},
"devDependencies": {
"@types/jest": "26.0.22",
"archiver": "5.3.0",
"axios": "0.21.1",
"copyfiles": "2.4.1",
"coveralls": "3.1.0",
"codecov": "3.8.3",
"download": "8.0.0",
"jest": "26.6.3",
"keep-a-changelog": "0.10.4",
"make-dir": "3.1.0",
"ora": "5.4.0",
"prettier": "2.2.1",
Expand Down
52 changes: 0 additions & 52 deletions scripts/ci/build_release.js

This file was deleted.

19 changes: 0 additions & 19 deletions scripts/ci/generate_release_notes.js

This file was deleted.

10 changes: 0 additions & 10 deletions scripts/ci/run_unit_tests.sh

This file was deleted.

0 comments on commit 05f4fc4

Please sign in to comment.