aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-03-04 19:22:20 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-03-04 19:22:20 -0800
commit665486dab831fb6eda79a35047b60a1fefb3b9e8 (patch)
tree3cfd18b96023623867d36addfc8fd05039ded538
parenta7cdd492440abee78624170161f57b3ac3c07d8f (diff)
downloadbun-665486dab831fb6eda79a35047b60a1fefb3b9e8.tar.gz
bun-665486dab831fb6eda79a35047b60a1fefb3b9e8.tar.zst
bun-665486dab831fb6eda79a35047b60a1fefb3b9e8.zip
Run tests
-rw-r--r--.github/workflows/bun-linux-build.yml88
-rw-r--r--.github/workflows/run-test-manually.yml19
2 files changed, 88 insertions, 19 deletions
diff --git a/.github/workflows/bun-linux-build.yml b/.github/workflows/bun-linux-build.yml
index d2c19ab1e..b099881ae 100644
--- a/.github/workflows/bun-linux-build.yml
+++ b/.github/workflows/bun-linux-build.yml
@@ -146,3 +146,91 @@ jobs:
name: "Canary (${{github.sha}})"
tag: "canary"
artifacts: "${{runner.temp}}/release/bun-${{matrix.tag}}.zip,${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip"
+
+ linux-test:
+ name: Tests ${{matrix.tag}}
+ runs-on: ubuntu-latest
+ needs: [linux]
+ timeout-minutes: 10
+ outputs:
+ failing_tests: ${{ steps.test.outputs.failing_tests }}
+ failing_tests_count: ${{ steps.test.outputs.failing_tests_count }}
+ 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: download
+ name: Download
+ uses: actions/download-artifact@v2
+ with:
+ name: bun-${{matrix.tag}}
+ path: ${{runner.temp}}/release
+ - id: install
+ name: Install
+ run: |
+ cd ${{runner.temp}}/release
+ unzip bun-${{matrix.tag}}.zip
+ cd bun-${{matrix.tag}}
+ chmod +x bun
+ sudo mv bun /usr/local/bin/bun
+ bun --version
+ - id: test-node-runner
+ name: Test (node runner)
+ # if: ${{github.event.inputs.use_bun == 'false'}}
+ run: |
+ bun install
+ bun install --cwd test/bun.js
+ bun install --cwd test/bun.js/third-party/body-parser-test
+ cd packages/bun-internal-test
+ bun install
+ node src/runner.node.mjs || true
+ - id: write-failing-tests
+ name: Check for failing tests
+ # if: ${{github.event.inputs.use_bun == 'false'}}
+ run: |
+ if [ -f failing-tests.txt ]; then
+ delimiter="$(openssl rand -hex 8)"
+ echo "failing_tests<<${delimiter}" >> "${GITHUB_OUTPUT}"
+ # prefix each non-empty line with a markdown bullet point
+ cat failing-tests.txt | sed -e 's/^/- /' >> "${GITHUB_OUTPUT}"
+ echo "${delimiter}" >> "${GITHUB_OUTPUT}"
+
+ echo "failing_tests_count<<$(cat failing-tests.txt | wc -l)" >> "${GITHUB_OUTPUT}"
+ fi
+
+ - name: Comment on PR
+ if: steps.fmt.outputs.failing_tests != '' && github.event_name == "pull_request"
+ uses: thollander/actions-comment-pull-request@v2
+ with:
+ comment_tag: test-failures-${{matrix.tag}}
+ message: |
+ ❌ @${{ github.actor }} ${{ steps.fmt.outputs.failing_tests_count }} failing tests on ${{ matrix.tag }}:
+
+ ${{ steps.fmt.outputs.failing_tests }}
+
+ **[View test output](https://github.com/repos/${{github.owner}}/${{github.repo}}/actions/runs/${{github.run_id}}/jobs)**
+
+ <sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup>
+ - name: Uncomment on PR
+ if: steps.fmt.outputs.failing_tests == '' && github.event_name == "pull_request"
+ uses: thollander/actions-comment-pull-request@v2
+ with:
+ comment_tag: test-failures-${{matrix.tag}}
+ mode: upsert
+ create_if_not_exists: false
+ message: |
+ ✅ test failures on ${{ matrix.tag }} have been resolved.
+
+ <sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup>
+ - id: fail
+ name: Fail the build
+ if: steps.fmt.outputs.failing_tests != ''
+ run: exit 1
diff --git a/.github/workflows/run-test-manually.yml b/.github/workflows/run-test-manually.yml
index 4790ba61d..cb03822ed 100644
--- a/.github/workflows/run-test-manually.yml
+++ b/.github/workflows/run-test-manually.yml
@@ -9,10 +9,6 @@ on:
required: true
default: "canary"
type: string
- artifact:
- description: "Artifact"
- required: false
- type: string
use_bun:
description: "Use Bun?"
required: true
@@ -37,25 +33,10 @@ jobs:
submodules: false
- id: install-npm
name: Install (npm)
- if: ${{github.event.inputs.artifact == ''}}
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: download-artifact
- name: Download (artifact)
- if: ${{github.event.inputs.artifact != ''}}
- uses: actions/download-artifact@v2
- with:
- name: ${{github.event.inputs.artifact}}
- path: ${{runner.temp}}/bun.zip
- - id: install-artifact
- name: Install (artifact)
- if: ${{github.event.inputs.artifact != ''}}
- run: |
- unzip ${{runner.temp}}/bun.zip -d ${{runner.temp}}
- chmod +x ${{runner.temp}}/bun
- sudo cp ${{runner.temp}}/bun /usr/bin/bun
- id: test
name: Test
if: ${{github.event.inputs.use_bun == 'true'}}