mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-02-23 18:50:10 +08:00
fix: close immediately (#75)
* fix * add test for outputs * ci: use correct outputs from setup bun * dist update * feat: add timeout * c * increase * [autofix.ci] apply automated fixes * refactor: remove unnecesary loging, decrease retries * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
932c3b236c
commit
8f24390df0
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@ -16,9 +16,6 @@ jobs:
|
|||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
|
||||||
- os: windows-latest
|
|
||||||
bun-version: canary
|
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- macos-latest
|
- macos-latest
|
||||||
@ -40,12 +37,15 @@ jobs:
|
|||||||
|
|
||||||
- name: Setup Bun
|
- name: Setup Bun
|
||||||
uses: ./
|
uses: ./
|
||||||
|
id: setup_bun
|
||||||
with:
|
with:
|
||||||
bun-version: ${{ matrix.bun-version }}
|
bun-version: ${{ matrix.bun-version }}
|
||||||
|
|
||||||
- name: Run Bun
|
- name: Run Bun
|
||||||
|
id: run_bun
|
||||||
run: |
|
run: |
|
||||||
bun --version
|
bun --version
|
||||||
|
|
||||||
setup-bun-from-package-json-version:
|
setup-bun-from-package-json-version:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
|
2
dist/setup/index.js
generated
vendored
2
dist/setup/index.js
generated
vendored
File diff suppressed because one or more lines are too long
@ -71,7 +71,9 @@ runAction({
|
|||||||
setOutput("bun-version", version);
|
setOutput("bun-version", version);
|
||||||
setOutput("bun-revision", revision);
|
setOutput("bun-revision", revision);
|
||||||
setOutput("cache-hit", cacheHit);
|
setOutput("cache-hit", cacheHit);
|
||||||
|
process.exit(0);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
setFailed(error);
|
setFailed(error);
|
||||||
|
process.exit(1);
|
||||||
});
|
});
|
||||||
|
10
src/utils.ts
10
src/utils.ts
@ -1,8 +1,14 @@
|
|||||||
export function retry<T>(fn: () => Promise<T>, retries: number): Promise<T> {
|
export function retry<T>(
|
||||||
|
fn: () => Promise<T>,
|
||||||
|
retries: number,
|
||||||
|
timeout = 10000
|
||||||
|
): Promise<T> {
|
||||||
return fn().catch((err) => {
|
return fn().catch((err) => {
|
||||||
if (retries <= 0) {
|
if (retries <= 0) {
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
return retry(fn, retries - 1);
|
return new Promise((resolve) => setTimeout(resolve, timeout)).then(() =>
|
||||||
|
retry(fn, retries - 1, timeout)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user