-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing workflows #10157
Merged
Merged
Testing workflows #10157
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
916b334
Testing workflows
Electroid 8ce6df1
Testing workflows
Electroid 8d084b0
Testing workflows
Electroid 7f169eb
Testing workflows
Electroid c3adc44
Testing workflows
Electroid d2e3575
Testing workflows
Electroid 80404be
Update .github/workflows/run-test.yml
Jarred-Sumner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,302 @@ | ||
name: Build Darwin | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
runs-on: | ||
type: string | ||
default: macos-12-large | ||
tag: | ||
type: string | ||
required: true | ||
arch: | ||
type: string | ||
required: true | ||
cpu: | ||
type: string | ||
required: true | ||
assertions: | ||
type: boolean | ||
canary: | ||
type: boolean | ||
no-cache: | ||
type: boolean | ||
|
||
env: | ||
LLVM_VERSION: 16 | ||
BUN_VERSION: 1.1.2 | ||
|
||
jobs: | ||
build-submodules: | ||
name: Build Submodules | ||
runs-on: ${{ inputs.runs-on }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
.gitmodules | ||
src/deps | ||
scripts | ||
- name: Hash Submodules | ||
id: hash | ||
run: | | ||
print_versions() { | ||
git submodule | grep -v WebKit | ||
echo "LLVM_VERSION=${{ env.LLVM_VERSION }}" | ||
cat $(echo scripts/build*.sh scripts/all-dependencies.sh | tr " " "\n" | sort) | ||
} | ||
echo "hash=$(print_versions | shasum)" >> $GITHUB_OUTPUT | ||
- if: ${{ !inputs.no-cache }} | ||
name: Restore Cache | ||
id: cache | ||
uses: actions/cache/restore@v4 | ||
with: | ||
path: ${{ runner.temp }}/bun-deps | ||
key: bun-${{ inputs.tag }}-deps-${{ steps.hash.outputs.hash }} | ||
# TODO: Figure out how to cache homebrew dependencies | ||
- if: ${{ inputs.no-cache || !steps.cache.outputs.cache-hit }} | ||
name: Install Dependencies | ||
env: | ||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 | ||
HOMEBREW_NO_AUTO_UPDATE: 1 | ||
HOMEBREW_NO_INSTALL_CLEANUP: 1 | ||
run: | | ||
brew install \ | ||
llvm@${{ env.LLVM_VERSION }} \ | ||
ccache \ | ||
rust \ | ||
pkg-config \ | ||
coreutils \ | ||
libtool \ | ||
cmake \ | ||
libiconv \ | ||
automake \ | ||
[email protected] \ | ||
ninja \ | ||
gnu-sed --force | ||
echo "$(brew --prefix ccache)/bin" >> $GITHUB_PATH | ||
echo "$(brew --prefix coreutils)/libexec/gnubin" >> $GITHUB_PATH | ||
echo "$(brew --prefix llvm@$LLVM_VERSION)/bin" >> $GITHUB_PATH | ||
brew link --overwrite llvm@$LLVM_VERSION | ||
- if: ${{ inputs.no-cache || !steps.cache.outputs.cache-hit }} | ||
name: Clone Submodules | ||
run: | | ||
./scripts/update-submodules.sh | ||
- name: Build Submodules | ||
if: ${{ inputs.no-cache || !steps.cache.outputs.cache-hit }} | ||
env: | ||
CPU_TARGET: ${{ inputs.cpu }} | ||
BUN_DEPS_OUT_DIR: ${{ runner.temp }}/bun-deps | ||
run: | | ||
mkdir -p $BUN_DEPS_OUT_DIR | ||
./scripts/all-dependencies.sh | ||
- name: Save Cache | ||
if: ${{ inputs.no-cache || !steps.cache.outputs.cache-hit }} | ||
uses: actions/cache/save@v4 | ||
with: | ||
path: ${{ runner.temp }}/bun-deps | ||
key: ${{ steps.cache.outputs.cache-primary-key }} | ||
- name: Upload bun-${{ inputs.tag }}-deps | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bun-${{ inputs.tag }}-deps | ||
path: ${{ runner.temp }}/bun-deps | ||
if-no-files-found: error | ||
build-cpp: | ||
name: Build C++ | ||
runs-on: ${{ inputs.runs-on }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
# TODO: Figure out how to cache homebrew dependencies | ||
- name: Install Dependencies | ||
env: | ||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 | ||
HOMEBREW_NO_AUTO_UPDATE: 1 | ||
HOMEBREW_NO_INSTALL_CLEANUP: 1 | ||
run: | | ||
brew install \ | ||
llvm@${{ env.LLVM_VERSION }} \ | ||
ccache \ | ||
rust \ | ||
pkg-config \ | ||
coreutils \ | ||
libtool \ | ||
cmake \ | ||
libiconv \ | ||
automake \ | ||
[email protected] \ | ||
ninja \ | ||
gnu-sed --force | ||
echo "$(brew --prefix ccache)/bin" >> $GITHUB_PATH | ||
echo "$(brew --prefix coreutils)/libexec/gnubin" >> $GITHUB_PATH | ||
echo "$(brew --prefix llvm@$LLVM_VERSION)/bin" >> $GITHUB_PATH | ||
brew link --overwrite llvm@$LLVM_VERSION | ||
- name: Setup Bun | ||
uses: ./.github/actions/setup-bun | ||
with: | ||
bun-version: ${{ env.BUN_VERSION }} | ||
- if: ${{ !inputs.no-cache }} | ||
name: Restore Cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ runner.temp }}/ccache | ||
key: bun-${{ inputs.tag }}-cpp-${{ hashFiles('Dockerfile', 'Makefile', 'CMakeLists.txt', 'build.zig', 'scripts/**', 'src/**', 'packages/bun-usockets/src/**', 'packages/bun-uws/src/**') }} | ||
restore-keys: | | ||
bun-${{ inputs.tag }}-cpp- | ||
- name: Compile | ||
env: | ||
CPU_TARGET: ${{ inputs.cpu }} | ||
SOURCE_DIR: ${{ github.workspace }} | ||
OBJ_DIR: ${{ runner.temp }}/bun-cpp-obj | ||
BUN_DEPS_OUT_DIR: ${{ runner.temp }}/bun-deps | ||
CCACHE_DIR: ${{ runner.temp }}/ccache | ||
run: | | ||
mkdir -p $OBJ_DIR | ||
cd $OBJ_DIR | ||
cmake -S $SOURCE_DIR -B $OBJ_DIR \ | ||
-G Ninja \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DUSE_LTO=ON \ | ||
-DBUN_CPP_ONLY=1 \ | ||
-DNO_CONFIGURE_DEPENDS=1 | ||
chmod +x compile-cpp-only.sh | ||
./compile-cpp-only.sh -v | ||
- name: Upload bun-${{ inputs.tag }}-cpp | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bun-${{ inputs.tag }}-cpp | ||
path: ${{ runner.temp }}/bun-cpp-obj/bun-cpp-objects.a | ||
if-no-files-found: error | ||
build-zig: | ||
name: Build Zig | ||
uses: ./.github/workflows/build-zig.yml | ||
with: | ||
os: darwin | ||
only-zig: true | ||
tag: ${{ inputs.tag }} | ||
arch: ${{ inputs.arch }} | ||
cpu: ${{ inputs.cpu }} | ||
assertions: ${{ inputs.assertions }} | ||
canary: ${{ inputs.canary }} | ||
no-cache: ${{ inputs.no-cache }} | ||
link: | ||
name: Link | ||
runs-on: ${{ inputs.runs-on }} | ||
needs: | ||
- build-submodules | ||
- build-cpp | ||
- build-zig | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# TODO: Figure out how to cache homebrew dependencies | ||
- name: Install Dependencies | ||
env: | ||
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1 | ||
HOMEBREW_NO_AUTO_UPDATE: 1 | ||
HOMEBREW_NO_INSTALL_CLEANUP: 1 | ||
run: | | ||
brew install \ | ||
llvm@${{ env.LLVM_VERSION }} \ | ||
ccache \ | ||
rust \ | ||
pkg-config \ | ||
coreutils \ | ||
libtool \ | ||
cmake \ | ||
libiconv \ | ||
automake \ | ||
[email protected] \ | ||
ninja \ | ||
gnu-sed --force | ||
echo "$(brew --prefix ccache)/bin" >> $GITHUB_PATH | ||
echo "$(brew --prefix coreutils)/libexec/gnubin" >> $GITHUB_PATH | ||
echo "$(brew --prefix llvm@$LLVM_VERSION)/bin" >> $GITHUB_PATH | ||
brew link --overwrite llvm@$LLVM_VERSION | ||
- name: Setup Bun | ||
uses: ./.github/actions/setup-bun | ||
with: | ||
bun-version: ${{ env.BUN_VERSION }} | ||
- name: Download bun-${{ inputs.tag }}-deps | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: bun-${{ inputs.tag }}-deps | ||
path: ${{ runner.temp }}/bun-deps | ||
- name: Download bun-${{ inputs.tag }}-cpp | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: bun-${{ inputs.tag }}-cpp | ||
path: ${{ runner.temp }}/bun-cpp-obj | ||
- name: Download bun-${{ inputs.tag }}-zig | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: bun-${{ inputs.tag }}-zig | ||
path: ${{ runner.temp }}/release | ||
- if: ${{ !inputs.no-cache }} | ||
name: Restore Cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ runner.temp }}/ccache | ||
key: bun-${{ inputs.tag }}-cpp-${{ hashFiles('Dockerfile', 'Makefile', 'CMakeLists.txt', 'build.zig', 'scripts/**', 'src/**', 'packages/bun-usockets/src/**', 'packages/bun-uws/src/**') }} | ||
restore-keys: | | ||
bun-${{ inputs.tag }}-cpp- | ||
- name: Link | ||
env: | ||
CPU_TARGET: ${{ inputs.cpu }} | ||
CCACHE_DIR: ${{ runner.temp }}/ccache | ||
run: | | ||
SRC_DIR=$PWD | ||
mkdir ${{ runner.temp }}/link-build | ||
cd ${{ runner.temp }}/link-build | ||
cmake $SRC_DIR \ | ||
-G Ninja \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-DUSE_LTO=ON \ | ||
-DBUN_LINK_ONLY=1 \ | ||
-DBUN_ZIG_OBJ="${{ runner.temp }}/release/bun-zig.o" \ | ||
-DBUN_CPP_ARCHIVE="${{ runner.temp }}/bun-cpp-obj/bun-cpp-objects.a" \ | ||
-DBUN_DEPS_OUT_DIR="${{ runner.temp }}/bun-deps" \ | ||
-DNO_CONFIGURE_DEPENDS=1 | ||
ninja -v | ||
- name: Prepare | ||
run: | | ||
cd ${{ runner.temp }}/link-build | ||
chmod +x bun-profile bun | ||
mkdir -p bun-${{ inputs.tag }}-profile/ bun-${{ inputs.tag }}/ | ||
mv bun-profile bun-${{ inputs.tag }}-profile/bun-profile | ||
mv bun bun-${{ inputs.tag }}/bun | ||
zip -r bun-${{ inputs.tag }}-profile.zip bun-${{ inputs.tag }}-profile | ||
zip -r bun-${{ inputs.tag }}.zip bun-${{ inputs.tag }} | ||
- name: Upload bun-${{ inputs.tag }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bun-${{ inputs.tag }} | ||
path: ${{ runner.temp }}/link-build/bun-${{ inputs.tag }}.zip | ||
if-no-files-found: error | ||
- name: Upload bun-${{ inputs.tag }}-profile | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: bun-${{ inputs.tag }}-profile | ||
path: ${{ runner.temp }}/link-build/bun-${{ inputs.tag }}-profile.zip | ||
if-no-files-found: error | ||
on-failure: | ||
if: ${{ github.repository_owner == 'oven-sh' && failure() }} | ||
name: On Failure | ||
needs: link | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send Message | ||
uses: sarisia/actions-status-discord@v1 | ||
with: | ||
webhook: ${{ secrets.DISCORD_WEBHOOK }} | ||
nodetail: true | ||
title: "" | ||
description: | | ||
### ❌ [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }}) | ||
|
||
@${{ github.actor }}, the build for bun-${{ inputs.tag }} failed. | ||
|
||
**[View logs](https://github.com/oven-sh/bun/actions/runs/${{ github.run_id }})** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Build Linux | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
runs-on: | ||
type: string | ||
required: true | ||
tag: | ||
type: string | ||
required: true | ||
arch: | ||
type: string | ||
required: true | ||
cpu: | ||
type: string | ||
required: true | ||
assertions: | ||
type: boolean | ||
zig-optimize: | ||
type: string | ||
canary: | ||
type: boolean | ||
no-cache: | ||
type: boolean | ||
|
||
jobs: | ||
build: | ||
name: Build Linux | ||
uses: ./.github/workflows/build-zig.yml | ||
with: | ||
os: linux | ||
only-zig: false | ||
runs-on: ${{ inputs.runs-on }} | ||
tag: ${{ inputs.tag }} | ||
arch: ${{ inputs.arch }} | ||
cpu: ${{ inputs.cpu }} | ||
assertions: ${{ inputs.assertions }} | ||
zig-optimize: ${{ inputs.zig-optimize }} | ||
canary: ${{ inputs.canary }} | ||
no-cache: ${{ inputs.no-cache }} | ||
on-failure: | ||
if: ${{ github.repository_owner == 'oven-sh' && failure() }} | ||
name: On Failure | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Send Message | ||
uses: sarisia/actions-status-discord@v1 | ||
with: | ||
webhook: ${{ secrets.DISCORD_WEBHOOK }} | ||
nodetail: true | ||
title: "" | ||
description: | | ||
### ❌ [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }}) | ||
|
||
@${{ github.actor }}, the build for bun-${{ inputs.tag }} failed. | ||
|
||
**[View logs](https://github.com/oven-sh/bun/actions/runs/${{ github.run_id }})** |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should add that 4th arg