From 4238249dd4139d25ba0c55eaf5a6f7ce5332eb54 Mon Sep 17 00:00:00 2001 From: Soma Lucz Date: Wed, 25 Mar 2020 23:50:54 +0100 Subject: [PATCH] ci: Configure GitHub Actions Closes #202. --- .github/workflows/ci.yml | 28 +++++++++++++++++++ .../continuous-integration-workflow.yml | 28 +++++++++++++++++++ README.md | 6 ++-- package.json | 8 ++---- sonar-project.properties | 1 + 5 files changed, 63 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/continuous-integration-workflow.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c497ee2 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node: [13, 12, 11, 10] + fail-fast: false + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - run: npm ci + - run: npx commitlint --from HEAD^ --to HEAD --config .commitlintrc.json + - run: npm run build-and-test-everything + - uses: sonarsource/sonarcloud-github-action@v1.1 + if: github.event_name == 'push' + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/continuous-integration-workflow.yml b/.github/workflows/continuous-integration-workflow.yml new file mode 100644 index 0000000..86dd395 --- /dev/null +++ b/.github/workflows/continuous-integration-workflow.yml @@ -0,0 +1,28 @@ +name: Continuous Integration workflow + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node: [13, 12, 11, 10] + fail-fast: false + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 2 + - uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node }} + - run: npm ci + - run: npx commitlint --from HEAD^ --to HEAD --config .commitlintrc.json + - run: npm run build-and-test-everything + - uses: sonarsource/sonarcloud-github-action@v1.1 + if: github.event_name == 'push' + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index b325d1e..830d073 100644 --- a/README.md +++ b/README.md @@ -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).

- - build status + + build status diff --git a/package.json b/package.json index 19b860b..e92baec 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,12 @@ { "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", @@ -14,8 +14,7 @@ "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 build-and-test-everything", "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" }, @@ -40,7 +39,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", diff --git a/sonar-project.properties b/sonar-project.properties index 0cc9f53..27220b7 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,4 +1,5 @@ # Standard properties +sonar.organization=diplomatiq sonar.projectKey=Diplomatiq_resily sonar.projectName=resily sonar.projectVersion=0.0.0