diff options
author | 2023-04-28 09:35:44 -0700 | |
---|---|---|
committer | 2023-04-28 09:35:44 -0700 | |
commit | 64b9967fe632961a2762bdbd4bfbaaf96198e0a1 (patch) | |
tree | f29df1a9647dbbf6c29722c722f3edccd7f3a9b2 | |
parent | ef894c57cfb864609455058e7834064797797302 (diff) | |
download | bun-64b9967fe632961a2762bdbd4bfbaaf96198e0a1.tar.gz bun-64b9967fe632961a2762bdbd4bfbaaf96198e0a1.tar.zst bun-64b9967fe632961a2762bdbd4bfbaaf96198e0a1.zip |
Improve test workflow
-rw-r--r-- | .github/workflows/bun-test.yml | 55 | ||||
-rw-r--r-- | .github/workflows/run-test-manually.yml | 39 | ||||
-rw-r--r-- | scripts/bun-test.ts | 1 |
3 files changed, 56 insertions, 39 deletions
diff --git a/.github/workflows/bun-test.yml b/.github/workflows/bun-test.yml new file mode 100644 index 000000000..039dc0a2c --- /dev/null +++ b/.github/workflows/bun-test.yml @@ -0,0 +1,55 @@ +name: Test + +on: + workflow_dispatch: + inputs: + version: + description: "The version of Bun to run" + required: true + default: "canary" + type: string + path: + description: "The path to the test files" + required: true + default: "test/" + type: string + timeout: + description: "The timeout per file in milliseconds" + required: true + default: "15000" + type: number +jobs: + test: + name: ${{ matrix.tag }} + runs-on: ${{ matrix.os }} + timeout-minutes: 10 + strategy: + fail-fast: false + matrix: + include: + - tag: linux-x64 + os: ubuntu-latest + - tag: linux-x64-baseline + os: ubuntu-latest + - tag: darwin-x64 + os: macos-latest + - tag: darwin-x64-baseline + os: macos-latest + steps: + - id: checkout + name: Checkout + uses: actions/checkout@v3 + with: + submodules: false + - id: setup + name: Setup + run: | + npm install @oven/bun-${{ matrix.tag }}@${{ github.event.inputs.version }} + chmod +x node_modules/@oven/bun-${{ matrix.tag }}/bin/bun + sudo cp node_modules/@oven/bun-${{ matrix.tag }}/bin/bun /usr/bin/bun + - id: test + name: Test + run: | + bun install + bun install --cwd test + bun x ts-node --esm scripts/bun-test.ts test/ --isolated --timeout=${{ github.event.inputs.timeout }} diff --git a/.github/workflows/run-test-manually.yml b/.github/workflows/run-test-manually.yml deleted file mode 100644 index 290ac8cc2..000000000 --- a/.github/workflows/run-test-manually.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Run Tests Manually - -on: - workflow_dispatch: - inputs: - version: - description: "Version" - required: true - default: "canary" - type: string -jobs: - linux-test: - name: Tests ${{matrix.tag}} ${{github.event.inputs.version}} - runs-on: ubuntu-latest - timeout-minutes: 10 - strategy: - fail-fast: false - matrix: - include: - - tag: linux-x64 - - tag: linux-x64-baseline - steps: - - id: checkout - name: Checkout - uses: actions/checkout@v3 - with: - submodules: false - - id: install-npm - name: Install (npm) - run: | - npm install @oven/bun-${{matrix.tag}}@${{github.event.inputs.version}} - chmod +x node_modules/@oven/bun-${{matrix.tag}}/bin/bun - sudo cp node_modules/@oven/bun-${{matrix.tag}}/bin/bun /usr/bin/bun - - id: test - name: Test - run: | - bun install - bun install --cwd test - bun x ts-node --esm scripts/bun-test.ts --isolated test/ diff --git a/scripts/bun-test.ts b/scripts/bun-test.ts index f0522a56f..59bccbfad 100644 --- a/scripts/bun-test.ts +++ b/scripts/bun-test.ts @@ -401,6 +401,7 @@ async function* runTest(options: RunTestOptions): AsyncGenerator<RunTestResult, "FORCE_COLOR": "1", }, stdio: "pipe", + timeout, }); let stderr = ""; let stdout = ""; |