diff options
author | 2023-03-08 08:30:53 +0200 | |
---|---|---|
committer | 2023-03-07 22:30:53 -0800 | |
commit | e389b6ef1985ffe54ecae212891e85013ece8ac0 (patch) | |
tree | bb7f741cccffa7e8eccda9f1b5f8d2c694b16217 | |
parent | 28346e4a390036270e393192550175a01d0e7f41 (diff) | |
download | bun-e389b6ef1985ffe54ecae212891e85013ece8ac0.tar.gz bun-e389b6ef1985ffe54ecae212891e85013ece8ac0.tar.zst bun-e389b6ef1985ffe54ecae212891e85013ece8ac0.zip |
run `bun test` after macOS builds (#2343)
-rw-r--r-- | .github/workflows/bun-mac-aarch64.yml | 72 | ||||
-rw-r--r-- | .github/workflows/bun-mac-x64-baseline.yml | 1 | ||||
-rw-r--r-- | .github/workflows/bun-mac-x64.yml | 72 |
3 files changed, 145 insertions, 0 deletions
diff --git a/.github/workflows/bun-mac-aarch64.yml b/.github/workflows/bun-mac-aarch64.yml index a6c19825e..642f20d0c 100644 --- a/.github/workflows/bun-mac-aarch64.yml +++ b/.github/workflows/bun-mac-aarch64.yml @@ -384,3 +384,75 @@ jobs: name: "Canary (${{github.sha}})" tag: "canary" artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip" + macOS-test: + name: Tests ${{matrix.tag}} + runs-on: ${{ matrix.runner }} + needs: [macOS] + if: github.event_name == 'pull_request' + 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: bun-darwin-aarch64 + runner: macos-arm64 + steps: + - id: checkout + name: Checkout + uses: actions/checkout@v3 + with: + submodules: false + - id: download + name: Download + uses: actions/download-artifact@v3 + with: + name: ${{matrix.tag}} + path: ${{runner.temp}}/release + - id: install + name: Install + run: | + cd ${{runner.temp}}/release + unzip ${{matrix.tag}}.zip + cd ${{matrix.tag}} + chmod +x bun + sudo mv bun /usr/local/bin/bun + bun --version + - id: test + name: Test (node runner) + # 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 + - name: Comment on PR + if: steps.test.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.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}})** + + <sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup> + - name: Uncomment on PR + if: steps.test.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.test.outputs.failing_tests != '' + run: exit 1 diff --git a/.github/workflows/bun-mac-x64-baseline.yml b/.github/workflows/bun-mac-x64-baseline.yml index b2430e93b..919333fa5 100644 --- a/.github/workflows/bun-mac-x64-baseline.yml +++ b/.github/workflows/bun-mac-x64-baseline.yml @@ -402,6 +402,7 @@ jobs: matrix: include: - tag: bun-darwin-x64-baseline + runner: macos-11 steps: - id: checkout name: Checkout diff --git a/.github/workflows/bun-mac-x64.yml b/.github/workflows/bun-mac-x64.yml index e4998a43e..434c43e4e 100644 --- a/.github/workflows/bun-mac-x64.yml +++ b/.github/workflows/bun-mac-x64.yml @@ -390,3 +390,75 @@ jobs: name: "Canary (${{github.sha}})" tag: "canary" artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip" + macOS-test: + name: Tests ${{matrix.tag}} + runs-on: ${{ matrix.runner }} + needs: [macOS] + if: github.event_name == 'pull_request' + 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: bun-darwin-x64 + runner: macos-11 + steps: + - id: checkout + name: Checkout + uses: actions/checkout@v3 + with: + submodules: false + - id: download + name: Download + uses: actions/download-artifact@v3 + with: + name: ${{matrix.tag}} + path: ${{runner.temp}}/release + - id: install + name: Install + run: | + cd ${{runner.temp}}/release + unzip ${{matrix.tag}}.zip + cd ${{matrix.tag}} + chmod +x bun + sudo mv bun /usr/local/bin/bun + bun --version + - id: test + name: Test (node runner) + # 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 + - name: Comment on PR + if: steps.test.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.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}})** + + <sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup> + - name: Uncomment on PR + if: steps.test.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.test.outputs.failing_tests != '' + run: exit 1 |