diff options
author | 2023-09-30 02:50:38 -0700 | |
---|---|---|
committer | 2023-09-30 02:50:38 -0700 | |
commit | c21be13be42f6ca9ec368bd52eee4dc6129f156c (patch) | |
tree | 30ed73bb735eb19649c2daf42cc35aeb8bb914be | |
parent | c0b758ad454780db7208a7600b0e73b213d3e7a9 (diff) | |
download | bun-c21be13be42f6ca9ec368bd52eee4dc6129f156c.tar.gz bun-c21be13be42f6ca9ec368bd52eee4dc6129f156c.tar.zst bun-c21be13be42f6ca9ec368bd52eee4dc6129f156c.zip |
tweak github actions (#6195)
* Discord comments
* better
* better
* actions
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
-rw-r--r-- | .github/workflows/bun-linux-build.yml | 48 | ||||
-rw-r--r-- | .github/workflows/bun-mac-aarch64.yml | 47 | ||||
-rw-r--r-- | .github/workflows/bun-mac-x64-baseline.yml | 50 | ||||
-rw-r--r-- | .github/workflows/bun-mac-x64.yml | 47 | ||||
-rw-r--r-- | test/js/node/fs/cp.test.ts | 2 |
5 files changed, 172 insertions, 22 deletions
diff --git a/.github/workflows/bun-linux-build.yml b/.github/workflows/bun-linux-build.yml index 2bc131baf..8eb1caaa9 100644 --- a/.github/workflows/bun-linux-build.yml +++ b/.github/workflows/bun-linux-build.yml @@ -153,7 +153,24 @@ jobs: name: "Canary (${{github.sha}})" tag: "canary" artifacts: "${{runner.temp}}/release/bun-${{matrix.tag}}.zip,${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip" + - uses: sarisia/actions-status-discord@v1 + if: failure() && github.repository_owner == 'oven-sh' && github.event_name == 'pull_request' + with: + title: "" + webhook: ${{ secrets.DISCORD_WEBHOOK }} + status: ${{ job.status }} + noprefix: true + nocontext: true + description: | + ### [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}}) + + @${{ github.actor }} + + Build failed on ${{ matrix.tag }}: + + **[View build output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})** + [Commit ${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}}) linux-test: name: Tests ${{matrix.tag}} runs-on: ubuntu-latest @@ -181,8 +198,8 @@ jobs: with: name: bun-${{matrix.tag}} path: ${{runner.temp}}/release - - id: install - name: Install + - id: install-bun + name: Install Bun run: | cd ${{runner.temp}}/release unzip bun-${{matrix.tag}}.zip @@ -190,6 +207,13 @@ jobs: chmod +x bun pwd >> $GITHUB_PATH ./bun --version + - id: install-dependnecies + name: Install dependencies + run: | + sudo apt-get update && sudo apt-get install -y openssl + bun install --verbose + bun install --cwd=test --verbose + bun install --cwd=packages/bun-internal-test --verbose - id: test name: Test (node runner) env: @@ -198,11 +222,23 @@ jobs: TLS_POSTGRES_DATABASE_URL: ${{ secrets.TLS_POSTGRES_DATABASE_URL }} # if: ${{github.event.inputs.use_bun == 'false'}} run: | - sudo apt-get update && sudo apt-get install -y openssl - bun install - bun install --cwd test - bun install --cwd packages/bun-internal-test node packages/bun-internal-test/src/runner.node.mjs || true + - uses: sarisia/actions-status-discord@v1 + if: always() && steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request' + with: + title: "" + webhook: ${{ secrets.DISCORD_WEBHOOK }} + status: "failure" + noprefix: true + nocontext: true + description: | + ### ❌ [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}}) + + @${{ github.actor }}, there are ${{ steps.test.outputs.failing_tests_count }} files with test failures on ${{ matrix.tag }}: + + ${{ steps.test.outputs.failing_tests }} + + **[View test output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})** - name: Comment on PR if: steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request' uses: thollander/actions-comment-pull-request@v2 diff --git a/.github/workflows/bun-mac-aarch64.yml b/.github/workflows/bun-mac-aarch64.yml index 4bc4d1494..da31dec54 100644 --- a/.github/workflows/bun-mac-aarch64.yml +++ b/.github/workflows/bun-mac-aarch64.yml @@ -393,6 +393,24 @@ jobs: name: "Canary (${{github.sha}})" tag: "canary" artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip" + - uses: sarisia/actions-status-discord@v1 + if: failure() && github.repository_owner == 'oven-sh' && github.event_name == 'pull_request' + with: + title: "" + webhook: ${{ secrets.DISCORD_WEBHOOK }} + status: ${{ job.status }} + noprefix: true + nocontext: true + description: | + ### [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}}) + + @${{ github.actor }} + + Build failed on ${{ matrix.tag }}: + + **[View build output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})** + + [Commit ${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}}) macOS-test: name: Tests ${{matrix.tag}} runs-on: ${{ matrix.runner }} @@ -420,8 +438,8 @@ jobs: with: name: ${{matrix.tag}} path: ${{runner.temp}}/release - - id: install - name: Install + - id: install-bun + name: Install Bun run: | cd ${{runner.temp}}/release unzip ${{matrix.tag}}.zip @@ -429,6 +447,12 @@ jobs: chmod +x bun pwd >> $GITHUB_PATH ./bun --version + - id: install + name: Install dependencies + run: | + bun install --verbose + bun install --cwd=test --verbose + bun install --cwd=packages/bun-internal-test --verbose - id: test name: Test (node runner) env: @@ -437,10 +461,23 @@ jobs: TLS_POSTGRES_DATABASE_URL: ${{ secrets.TLS_POSTGRES_DATABASE_URL }} # if: ${{github.event.inputs.use_bun == 'false'}} run: | - bun install - bun install --cwd test - bun install --cwd packages/bun-internal-test node packages/bun-internal-test/src/runner.node.mjs || true + - uses: sarisia/actions-status-discord@v1 + if: always() && steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request' + with: + title: "" + webhook: ${{ secrets.DISCORD_WEBHOOK }} + status: "failure" + noprefix: true + nocontext: true + description: | + ### ❌ [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}}) + + @${{ github.actor }}, there are ${{ steps.test.outputs.failing_tests_count }} files with test failures on ${{ matrix.tag }}: + + ${{ steps.test.outputs.failing_tests }} + + **[View test output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})** - name: Comment on PR if: steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request' uses: thollander/actions-comment-pull-request@v2 diff --git a/.github/workflows/bun-mac-x64-baseline.yml b/.github/workflows/bun-mac-x64-baseline.yml index cf3281bd8..eec472c18 100644 --- a/.github/workflows/bun-mac-x64-baseline.yml +++ b/.github/workflows/bun-mac-x64-baseline.yml @@ -397,6 +397,24 @@ jobs: name: "Canary (${{github.sha}})" tag: "canary" artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip" + - uses: sarisia/actions-status-discord@v1 + if: failure() && github.repository_owner == 'oven-sh' && github.event_name == 'pull_request' + with: + title: "" + webhook: ${{ secrets.DISCORD_WEBHOOK }} + status: ${{ job.status }} + noprefix: true + nocontext: true + description: | + ### [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}}) + + @${{ github.actor }} + + Build failed on ${{ matrix.tag }}: + + **[View build output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})** + + [Commit ${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}}) macOS-test: name: Tests ${{matrix.tag}} runs-on: ${{ matrix.runner }} @@ -424,8 +442,8 @@ jobs: with: name: ${{matrix.tag}} path: ${{runner.temp}}/release - - id: install - name: Install + - id: install-bun + name: Install Bun run: | cd ${{runner.temp}}/release unzip ${{matrix.tag}}.zip @@ -433,6 +451,12 @@ jobs: chmod +x bun pwd >> $GITHUB_PATH ./bun --version + - id: install + name: Install dependencies + run: | + bun install --verbose + bun install --cwd=test --verbose + bun install --cwd=packages/bun-internal-test --verbose - id: test name: Test (node runner) env: @@ -441,10 +465,26 @@ jobs: TLS_POSTGRES_DATABASE_URL: ${{ secrets.TLS_POSTGRES_DATABASE_URL }} # if: ${{github.event.inputs.use_bun == 'false'}} run: | - bun install - bun install --cwd test - bun install --cwd packages/bun-internal-test node packages/bun-internal-test/src/runner.node.mjs || true + - uses: sarisia/actions-status-discord@v1 + if: always() && steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request' + with: + title: "" + webhook: ${{ secrets.DISCORD_WEBHOOK }} + status: "failure" + noprefix: true + nocontext: true + description: | + ### ❌ [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}}) + + Hey @${{ github.actor }}, + + ${{ steps.test.outputs.failing_tests_count }} files with test failures on ${{ matrix.tag }}: + + ${{ steps.test.outputs.failing_tests }} + + **[View test output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})** + - name: Comment on PR if: steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request' uses: thollander/actions-comment-pull-request@v2 diff --git a/.github/workflows/bun-mac-x64.yml b/.github/workflows/bun-mac-x64.yml index a1d8b057a..76d7d8df2 100644 --- a/.github/workflows/bun-mac-x64.yml +++ b/.github/workflows/bun-mac-x64.yml @@ -399,6 +399,24 @@ jobs: name: "Canary (${{github.sha}})" tag: "canary" artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip" + - uses: sarisia/actions-status-discord@v1 + if: failure() && github.repository_owner == 'oven-sh' && github.event_name == 'pull_request' + with: + title: "" + webhook: ${{ secrets.DISCORD_WEBHOOK }} + status: ${{ job.status }} + noprefix: true + nocontext: true + description: | + ### [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}}) + + @${{ github.actor }} + + Build failed on ${{ matrix.tag }}: + + **[View build output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})** + + [Commit ${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}}) macOS-test: name: Tests ${{matrix.tag}} runs-on: ${{ matrix.runner }} @@ -426,8 +444,8 @@ jobs: with: name: ${{matrix.tag}} path: ${{runner.temp}}/release - - id: install - name: Install + - id: install-bun + name: Install Bun run: | cd ${{runner.temp}}/release unzip ${{matrix.tag}}.zip @@ -435,6 +453,12 @@ jobs: chmod +x bun pwd >> $GITHUB_PATH ./bun --version + - id: install + name: Install dependencies + run: | + bun install --verbose + bun install --cwd=test --verbose + bun install --cwd=packages/bun-internal-test --verbose - id: test name: Test (node runner) env: @@ -443,10 +467,23 @@ jobs: TLS_POSTGRES_DATABASE_URL: ${{ secrets.TLS_POSTGRES_DATABASE_URL }} # if: ${{github.event.inputs.use_bun == 'false'}} run: | - bun install - bun install --cwd test - bun install --cwd packages/bun-internal-test node packages/bun-internal-test/src/runner.node.mjs || true + - uses: sarisia/actions-status-discord@v1 + if: always() && steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request' + with: + title: "" + webhook: ${{ secrets.DISCORD_WEBHOOK }} + status: "failure" + noprefix: true + nocontext: true + description: | + ### ❌ [${{github.event.pull_request.title}}](https://github.com/oven-sh/bun/pull/${{github.event.number}}) + + @${{ github.actor }}, there are ${{ steps.test.outputs.failing_tests_count }} files with test failures on ${{ matrix.tag }}: + + ${{ steps.test.outputs.failing_tests }} + + **[View test output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})** - name: Comment on PR if: steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request' uses: thollander/actions-comment-pull-request@v2 diff --git a/test/js/node/fs/cp.test.ts b/test/js/node/fs/cp.test.ts index eae8a0e77..33b9aa700 100644 --- a/test/js/node/fs/cp.test.ts +++ b/test/js/node/fs/cp.test.ts @@ -12,7 +12,7 @@ for (const [name, copy] of impls) { try { await (copy as any)(...args); } catch (e: any) { - if (e?.code?.toUpperCase() === "TODO") { + if ((e?.code? ?? "").toUpperCase() === "TODO") { throw new Error("Expected " + name + "() to throw non TODO error"); } return e; |