Skip to content

Commit

Permalink
ci: Configure GitHub Actions
Browse files Browse the repository at this point in the history
Closes #202.
  • Loading branch information
luczsoma committed Mar 28, 2020
1 parent 4386906 commit b09a145
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 31 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on: [push, pull_request]

jobs:
lint-build-test-scan:
name: Lint, build, test, scan
runs-on: ubuntu-latest

strategy:
matrix:
node: [13, 12, 11, 10]
fail-fast: false

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 2
- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci
- name: Lint the commit message
run: npx commitlint --from HEAD^ --to HEAD --config .commitlintrc.json
- name: Lint the code
run: npm run lint
- name: Build the code
run: npm run build
- name: Test the code
run: npm run test
- name: Scan the code with SonarCloud
uses: sonarsource/[email protected]
if: github.event_name == 'push'
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# resily

Resily is a TypeScript resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback. Inspired by [App-vNext/Polly](https://github.com/App-vNext/Polly).
Resily is a TypeScript resilience and transient-fault-handling library that allows developers to express policies such as Retry, Fallback, Circuit Breaker, Timeout, Bulkhead Isolation, and Cache. Inspired by [App-vNext/Polly](https://github.com/App-vNext/Polly).

<p>
<a href="https://travis-ci.org/Diplomatiq/resily" target="_blank" style="text-decoration: none;">
<img src="https://img.shields.io/travis/Diplomatiq/resily.svg" alt="build status">
<a href="https://github.com/Diplomatiq/resily/actions?query=workflow%3ACI" target="_blank" style="text-decoration: none;">
<img src="https://github.com/Diplomatiq/resily/workflows/CI/badge.svg" alt="build status">
</a>

<a href="https://github.com/Diplomatiq/resily" target="_blank" style="text-decoration: none;">
Expand Down
11 changes: 4 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
{
"name": "@diplomatiq/resily",
"version": "0.0.0",
"description": "Resily is a TypeScript resilience and transient-fault-handling library that allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback. Inspired by App-vNext/Polly.",
"description": "Resily is a TypeScript resilience and transient-fault-handling library that allows developers to express policies such as Retry, Fallback, Circuit Breaker, Timeout, Bulkhead Isolation, and Cache. Inspired by App-vNext/Polly.",
"main": "dist/main.js",
"module": "dist/main.js",
"types": "dist/main.d.ts",
"engines": {
"node": ">=9.0.0"
"node": ">=10.0.0"
},
"scripts": {
"build": "tsc",
"build-and-test-everything": "npm run lint && npm run build && npm run test",
"check-release-tag": "node --experimental-modules scripts/check-release-tag.mjs",
"clean": "rm -r ./dist/",
"lint": "eslint ./src/ ./test/ --ext .ts",
"prepare": "npm run build-and-test-everything",
"prepublishOnly": "npm run check-release-tag",
"prepublishOnly": "npm run check-release-tag && npm run lint && npm run build && npm run test",
"test": "cross-env-shell TS_NODE_PROJECT=tsconfig.test.json nyc --reporter=lcov --reporter=text mocha --require ts-node/register --require source-map-support/register --require esm --recursive test/specs/**/*.test.ts",
"version": "node --experimental-modules scripts/sync-sonar-version.mjs && conventional-changelog -p angular -i CHANGELOG.md -s && git add sonar-project.properties CHANGELOG.md"
},
Expand All @@ -40,7 +38,6 @@
"homepage": "https://github.com/Diplomatiq/resily#readme",
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/travis-cli": "^8.3.5",
"@diplomatiq/eslint-config-tslib": "^3.0.0",
"@types/chai": "^4.2.11",
"@types/mocha": "^7.0.2",
Expand All @@ -65,7 +62,7 @@
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-push": "npm run build-and-test-everything"
"pre-push": "npm run lint && npm run build && npm run test"
}
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Standard properties
sonar.organization=diplomatiq
sonar.projectKey=Diplomatiq_resily
sonar.projectName=resily
sonar.projectVersion=0.0.0
Expand Down
2 changes: 1 addition & 1 deletion test/specs/retryPolicy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe('RetryPolicy', (): void => {
expect(result).to.equal('Diplomatiq is the coolest.');
});

it('should retry on a reactive exception once, then throw by default', async (): Promise<void> => {
it.only('should retry on a reactive exception once, then throw by default', async (): Promise<void> => {
const policy = new RetryPolicy();
policy.reactOnException((e: unknown): boolean => (e as Error).message === 'TestException');

Expand Down

0 comments on commit b09a145

Please sign in to comment.