mirror of
https://github.com/nick-fields/retry.git
synced 2026-02-10 07:05:29 +00:00
Compare commits
4 Commits
snyk-upgra
...
snyk-upgra
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
448ab8cbac | ||
|
|
dfb235ae84 | ||
|
|
3f757583fb | ||
|
|
7152eba30c |
84
.github/workflows/ci_cd.yml
vendored
84
.github/workflows/ci_cd.yml
vendored
@@ -14,11 +14,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Run Unit Tests
|
||||
@@ -33,11 +33,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
@@ -143,11 +143,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: env-vars-passed-through
|
||||
@@ -164,11 +164,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Test 100MiB of output can be processed
|
||||
@@ -195,11 +195,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: retry_on_exit_code (with expected error code)
|
||||
@@ -243,11 +243,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: happy-path (continue_on_error)
|
||||
@@ -290,11 +290,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
@@ -326,11 +326,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
@@ -369,11 +369,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
@@ -399,11 +399,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
@@ -430,11 +430,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
@@ -465,11 +465,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
@@ -495,11 +495,11 @@ jobs:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Powershell test
|
||||
@@ -571,11 +571,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Release
|
||||
|
||||
22
README.md
22
README.md
@@ -79,7 +79,7 @@ The final error returned by the command
|
||||
### Shell
|
||||
|
||||
```yaml
|
||||
uses: nick-fields/retry@v2
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_minutes: 10
|
||||
max_attempts: 3
|
||||
@@ -90,7 +90,7 @@ with:
|
||||
### Timeout in minutes
|
||||
|
||||
```yaml
|
||||
uses: nick-fields/retry@v2
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_minutes: 10
|
||||
max_attempts: 3
|
||||
@@ -100,7 +100,7 @@ with:
|
||||
### Timeout in seconds
|
||||
|
||||
```yaml
|
||||
uses: nick-fields/retry@v2
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_seconds: 15
|
||||
max_attempts: 3
|
||||
@@ -110,7 +110,7 @@ with:
|
||||
### Only retry after timeout
|
||||
|
||||
```yaml
|
||||
uses: nick-fields/retry@v2
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_seconds: 15
|
||||
max_attempts: 3
|
||||
@@ -121,7 +121,7 @@ with:
|
||||
### Only retry after error
|
||||
|
||||
```yaml
|
||||
uses: nick-fields/retry@v2
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_seconds: 15
|
||||
max_attempts: 3
|
||||
@@ -132,7 +132,7 @@ with:
|
||||
### Retry using continue_on_error input (in composite action) but allow failure and do something with output
|
||||
|
||||
```yaml
|
||||
- uses: nick-fields/retry@v2
|
||||
- uses: nick-fields/retry@v3
|
||||
id: retry
|
||||
with:
|
||||
timeout_seconds: 15
|
||||
@@ -154,7 +154,7 @@ with:
|
||||
### Retry using continue-on-error built-in command (in workflow action) but allow failure and do something with output
|
||||
|
||||
```yaml
|
||||
- uses: nick-fields/retry@v2
|
||||
- uses: nick-fields/retry@v3
|
||||
id: retry
|
||||
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idcontinue-on-error
|
||||
continue-on-error: true
|
||||
@@ -183,7 +183,7 @@ with:
|
||||
### Run script after failure but before retry
|
||||
|
||||
```yaml
|
||||
uses: nick-fields/retry@v2
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_seconds: 15
|
||||
max_attempts: 3
|
||||
@@ -194,7 +194,7 @@ with:
|
||||
### Run different command after first failure
|
||||
|
||||
```yaml
|
||||
uses: nick-fields/retry@v2
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_seconds: 15
|
||||
max_attempts: 3
|
||||
@@ -206,7 +206,7 @@ with:
|
||||
|
||||
```yaml
|
||||
name: Multi-line multi-command Test
|
||||
uses: ./
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_minutes: 1
|
||||
max_attempts: 2
|
||||
@@ -219,7 +219,7 @@ with:
|
||||
|
||||
```yaml
|
||||
name: Multi-line single-command Test
|
||||
uses: ./
|
||||
uses: nick-fields/retry@v3
|
||||
with:
|
||||
timeout_minutes: 1
|
||||
max_attempts: 2
|
||||
|
||||
@@ -50,5 +50,5 @@ outputs:
|
||||
exit_error:
|
||||
description: The final error returned by the command
|
||||
runs:
|
||||
using: 'node16'
|
||||
using: 'node20'
|
||||
main: 'dist/index.js'
|
||||
|
||||
28719
dist/index.js
vendored
28719
dist/index.js
vendored
File diff suppressed because one or more lines are too long
16436
package-lock.json
generated
16436
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -23,7 +23,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/nick-invision/retry#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.10.0",
|
||||
"@actions/core": "^1.11.1",
|
||||
"milliseconds": "^1.0.3",
|
||||
"tree-kill": "^1.2.2"
|
||||
},
|
||||
@@ -37,7 +37,7 @@
|
||||
"@types/node": "^16.11.7",
|
||||
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
||||
"@typescript-eslint/parser": "^5.32.0",
|
||||
"@zeit/ncc": "^0.20.5",
|
||||
"@vercel/ncc": "^0.38.1",
|
||||
"dotenv": "8.2.0",
|
||||
"eslint": "^8.21.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
|
||||
@@ -3,6 +3,11 @@ import { getHeapStatistics } from 'v8';
|
||||
|
||||
import { wait } from './util';
|
||||
|
||||
// otherwise, TypeError: Cannot assign to read only property 'performance' of object '[object global]'
|
||||
Object.defineProperty(global, 'performance', {
|
||||
writable: true,
|
||||
});
|
||||
|
||||
// mocks the setTimeout function, see https://jestjs.io/docs/timer-mocks
|
||||
jest.useFakeTimers();
|
||||
jest.spyOn(global, 'setTimeout');
|
||||
|
||||
Reference in New Issue
Block a user