Skip to content

Commit

Permalink
github actions (oven-sh#91)
Browse files Browse the repository at this point in the history
* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update Dockerfile

* switch

* 😯

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* wip

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* cache is broken

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* Update bun.yml

* bust it

* Update Dockerfile

* jm

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update Dockerfile

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* wip

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* Update Makefile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* pass executablePath

* alright

* Update Makefile

* Update Dockerfile

* Update Dockerfile

* Update Makefile

* Update Makefile

* Update Dockerfile

* lets try that

* Update Dockerfile

* Update bun.yml

* hm

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* not interactive

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* simplify this

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* missing

* Update Dockerfile

* Update Dockerfile

* wrong dir

* Update Dockerfile

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* Update bun.yml

* ordering

* Update Dockerfile

* Update bun.yml

* run-test file

* pass github workspace

* hm

* Update bun.yml

* copy the file

* Update run-test.sh

* Update bun.yml

* Update bun.yml

* Update bun.yml

* try this way

* Update bun.yml

* maybe?

* Update bun.yml

* maybe taht's it?

* maybe this

* cache

* up

* Update bun.yml

* Update bun.yml

* try this one i guess

* okay that might do it

* Update Dockerfile

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update chrome.json

* Update chrome.json

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* hm

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* fix caching I think

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* Update bun.yml

* maybe

* Update bun.yml

* fixup

* Update bun.yml

* Update bun.yml

* Update bun.yml

* maybe this time

* Update bun.yml

* Update Dockerfile

* random name

* ok

* explicit runner

* Update bun.yml

* Update bun.yml

* try deleting the files so the layer caching doesn't happen

* 🏃

* Update bun.yml

* Update bun.yml

* Update Dockerfile

* Update Dockerfile

* Update Dockerfile

* Dockerfile.base

* node.js

* Update bun.yml

* Update Dockerfile

* Update Dockerfile.base

* cleanup
  • Loading branch information
Jarred-Sumner authored Dec 26, 2021
1 parent 99446ff commit 536d6ab
Show file tree
Hide file tree
Showing 16 changed files with 2,021 additions and 250 deletions.
1,539 changes: 1,539 additions & 0 deletions .docker/chrome.json

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions .docker/copy-bun-binary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

set -euxo pipefail

name=$(openssl rand -hex 12)
id=$(docker create --name=bun-binary-$name $CONTAINER_TAG)
docker container cp bun-binary-$name:$BUN_RELEASE_DIR bun-binary
echo -e "bun-binary-$name"
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions .docker/run-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

set -euxo pipefail

bun install
bun install --cwd ./integration/snippets
bun install --cwd ./integration/scripts

make $BUN_TEST_NAME
5 changes: 5 additions & 0 deletions .docker/runner.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

set -euxo pipefail

docker container run --security-opt seccomp=.docker/chrome.json --env GITHUB_WORKSPACE=$GITHUB_WORKSPACE --env BUN_TEST_NAME=$BUN_TEST_NAME --ulimit memlock=-1:-1 --init --rm bun-test:latest
100 changes: 90 additions & 10 deletions .github/workflows/bun.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,108 @@
name: CI workflow for bun
name: bun
on:
push:
branches: [main, bun-actions]
pull_request:
branches: [main]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TEST_TAG: bun-test'

jobs:
release:
runs-on: ubuntu:20.04
tests:
runs-on: self-hosted
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Checkout submodules
run: git -c submodule."src/javascript/jsc/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j 8
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push
- name: Login to Dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Pull Base Image
if: steps.cache-builds.outputs.cache-hit != 'true'
run: docker pull bunbunbunbun/bun-test-base:latest && docker pull bunbunbunbun/bun-base:latest && docker pull bunbunbunbun/bun-base-with-zig-and-webkit:latest && docker tag bun-base:latest bunbunbunbun/bun-base && docker tag bun-base-with-zig-and-webkit:latest bunbunbunbun/bun-base-with-zig-and-webkit:latest
- name: Build Release Image
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: jarred-sumner/bun:${{steps.vars.outputs.tag}}
target: release
tags: bun:${{github.sha}}
builder: ${{ steps.buildx.outputs.name }}
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
- name: Build tests
uses: docker/build-push-action@v2
with:
context: .
target: test_base
tags: bun-test:latest
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
ulimit: "memlock=-1:-1 core=-1:-1"
builder: ${{ steps.buildx.outputs.name }}
- name: Run test-with-hmr
env:
BUN_TEST_NAME: test-with-hmr
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
RUNNER_TEMP: ${RUNNER_TEMP}
run: bash .docker/runner.sh
- name: Run test-no-hmr
env:
BUN_TEST_NAME: test-no-hmr
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
RUNNER_TEMP: ${RUNNER_TEMP}
run: bash .docker/runner.sh
- name: Run test-bun-create-next
env:
RUNNER_TEMP: ${RUNNER_TEMP}
BUN_TEST_NAME: test-create-next
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
run: bash .docker/runner.sh
- name: Run test-bun-create-react
env:
RUNNER_TEMP: ${RUNNER_TEMP}
BUN_TEST_NAME: test-create-react
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
run: bash .docker/runner.sh
- name: Run test-bun-run
env:
RUNNER_TEMP: ${RUNNER_TEMP}
BUN_TEST_NAME: test-bun-run
GITHUB_WORKSPACE: $GITHUB_WORKSPACE
run: bash .docker/runner.sh

release:
runs-on: self-hosted
needs: tests
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checkout submodules
run: git -c submodule."src/javascript/jsc/WebKit".update=none submodule update --init --recursive --depth=1 --progress -j 8
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
install: true
- name: Build release image
uses: docker/build-push-action@v2
with:
context: .
target: release
tags: ghcr.io/jarred-sumner/bun:${{github.sha}}
builder: ${{ steps.buildx.outputs.name }}
push: true
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,5 @@ src/tests.zig
src/deps/s2n-tls
.npm
.npm.gz

bun-binary
Loading

0 comments on commit 536d6ab

Please sign in to comment.