Skip to content

Commit

Permalink
Try building android
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidokert committed Jul 13, 2024
1 parent c1ce0e7 commit 9f71a06
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 0 deletions.
140 changes: 140 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
name: Docker Build

on:
pull_request:
types: [opened, reopened, synchronize]
branches:
- dev_workflows
push:
branches:
- dev_workflows
workflow_dispatch:

jobs:
docker-build-image:
runs-on: ubuntu-latest

env:
docker_tag: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref_name }}

steps:
- uses: actions/checkout@v4
#- name: Dump context
# uses: crazy-max/ghaction-dump-context@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull just in case
run: docker pull ghcr.io/${{ github.repository }}/linux || true
- name: Build containers using docker-compose
run: docker-compose build
- name: Re-tag
run: docker tag ghcr.io/${{ github.repository }}/linux:latest ghcr.io/${{ github.repository }}/linux:${{ env.docker_tag }}
- name: Work
run: docker push ghcr.io/${{ github.repository }}/linux:${{ env.docker_tag }}
outputs:
docker_tag: ghcr.io/${{ github.repository }}/linux:${{ env.docker_tag }}

build:
needs: [docker-build-image]
runs-on: [self-hosted, chrobalt-linux-runner]
container: ${{ needs.docker-build-image.outputs.docker_tag }}
env:
DEPOT_TOOLS_UPDATE: 0
DEPOT_TOOLS_REPORT_BUILD: 0
DEPOT_TOOLS_COLLECT_METRICS: 0
DEPOT_TOOLS_METRICS: 0
SCCACHE: 1
SCCACHE_GCS_BUCKET: cobalt-actions-sccache-linux
SCCACHE_GCS_SERVICE_ACCOUNT: [email protected]
SCCACHE_GCS_RW_MODE: READ_WRITE
SCCACHE_IDLE_TIMEOUT: 0 # prevent sccache server from shutting down after long idle.
BUILD_DIR: out/Default

steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: src
# - name: Dump context
# uses: crazy-max/ghaction-dump-context@v2
- name: Get depot tools
# run: git clone -b dev https://github.com/kaidokert/depot_tools.git
run: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
- name: Add directory to PATH
run: echo "$GITHUB_WORKSPACE/depot_tools" >> $GITHUB_PATH
- name: Generate gclient file
run: gclient config --name=src https://github.com/${{ github.repository }}
- name: Set target OS
run: |
echo "target_os=['android']" >> .gclient
echo "target_os_only=True" >> .gclient
gclient validate
- name: Gclient sync
run: gclient sync -v --shallow --no-history -r ${{ github.sha }}
- name: DF
run: df -h
- name: Du
run: du -ht 500M
- name: sccache check
run: sccache -s
- name: gn gen
run: |
cd src
mkdir -p ${BUILD_DIR}
cp chrobalt/android/args.gn ${BUILD_DIR}
gn gen ${BUILD_DIR}
- name: gn dump args
run: |
cd src
gn args --list --short ${BUILD_DIR}
- name: ninja base_unittests
run: |
cd src
ninja -C ${BUILD_DIR} base_unittests
- name: ninja sql_unittests
run: |
cd src
ninja -C ${BUILD_DIR} sql_unittests
- name: ninja net_unittests
run: |
cd src
ninja -C ${BUILD_DIR} net_unittests
- name: ninja url_unittests
run: |
cd src
ninja -C ${BUILD_DIR} url_unittests
- name: ninja ipc_tests
run: |
cd src
ninja -C ${BUILD_DIR} ipc_tests
- name: ninja mojo_unittests
run: |
cd src
ninja -C ${BUILD_DIR} mojo_unittests
- name: ninja gpu_unittests
run: |
cd src
ninja -C ${BUILD_DIR} gpu_unittests
# V8 utility stuff
- name: ninja gin_unittests
run: |
cd src
ninja -C ${BUILD_DIR} gin_unittests
- name: ninja blink_unittests
run: |
cd src
ninja -C ${BUILD_DIR} blink_unittests
- name: ninja content_shell
run: |
cd src
ninja -C ${BUILD_DIR} content_shell
- name: sccache check
run: sccache -s
- name: Any speed
run: echo Any speed
4 changes: 4 additions & 0 deletions chrobalt/android/args.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cc_wrapper = "sccache"
symbol_level = 0
target_os = "android"
target_cpu = "arm64"
2 changes: 2 additions & 0 deletions docker/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM debian:12
# Install any necessary dependencies
# NOTE: From libxcomposite down, these are minimal requirements to run a
# V8 snapshot binary, on X11/GTK builds
# gcc-multilib for cross-builds of v8/32bit arm
RUN apt-get update && apt-get install -y \
curl python3-dev git \
xz-utils \
Expand All @@ -22,6 +23,7 @@ RUN apt-get update && apt-get install -y \
libasound2 \
libxkbcommon0 \
libpango-1.0-0 \
gcc-multilib \
&& rm -rf /var/lib/apt/lists/*

ADD files/sccache /usr/local/bin
Expand Down

0 comments on commit 9f71a06

Please sign in to comment.