Skip to content
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

Fix PGO #11

Draft
wants to merge 5 commits into
base: dev/m114_ci
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build Cobalt
description: Builds Cobalt targets
inputs:
targets:
description: "List of ninja targets for Chrobalt build."
required: true
runs:
using: "composite"
steps:
- name: Get depot tools
run: git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
shell: bash
- name: Add directory to PATH
run: echo "$GITHUB_WORKSPACE/depot_tools" >> $GITHUB_PATH
shell: bash
- name: Generate gclient file
run: gclient config --name=src https://github.com/${{ github.repository }}
shell: bash
- name: Gclient sync
run: gclient sync -v --shallow --no-history -r ${{ github.sha }}
shell: bash
- name: sccache check
run: sccache -s
shell: bash
- name: gn gen
run: |
cd src
chrobalt/build/gn.py -p ${{ matrix.platform }} -C ${{ matrix.config }} --no-check
shell: bash
- name: gn dump args
run: |
cd src
gn args --list --short out/${{ matrix.platform }}_${{ matrix.config }}
shell: bash
- name: ninja build
env:
TARGETS: ${{ inputs.targets }}
run: |
cd src
ninja -C out/${{ matrix.platform }}_${{ matrix.config }} $(echo "${TARGETS}" | tr -d '"')
shell: bash
- name: sccache check
run: sccache -s
shell: bash
19 changes: 19 additions & 0 deletions .github/actions/pre_commit/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: pre-commit
description: Runs pre-commit
inputs:
base_ref:
description: "Ref to run from"
required: true
runs:
using: "composite"
steps:
- run: python -m pip install pre-commit
shell: bash
- run: python -m pip freeze --local
shell: bash
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- run: pre-commit run --show-diff-on-failure --color=always --all-files
shell: bash
24 changes: 24 additions & 0 deletions .github/config/linux.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"docker_service": "linux",
"platforms": [
"linux-x64x11"
],
"targets": [
"base_unittests",
"sql_unittests",
"net_unittests",
"url_unittests",
"ipc_tests",
"mojo_unittests",
"gpu_unittests",
"gin_unittests",
"blink_unittests",
"content_shell"
],
"includes": [
{
"name":"x64",
"platform":"linux-x64x11"
}
]
}
162 changes: 162 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: Android build

on:
pull_request:
types: [opened, reopened, synchronize]
branches:
- 'dev/m114_ci'
push:
branches:
- 'dev/m114_ci'
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: 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: |
tag=${{ env.docker_tag }}
tag=${tag//\//__}
echo "docker_tag=${tag}" | head -n 1 >> $GITHUB_ENV
docker tag ghcr.io/${{ github.repository }}/linux:latest ghcr.io/${{ github.repository }}/linux:${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/android-arm64_qa

steps:
- name: Checkout
uses: actions/checkout@v4
with:
path: src
- name: Get depot tools
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
# echo "target_os_only=True" >> .gclient
run: |
echo "target_os=['android']" >> .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
chrobalt/build/gn.py -p android-arm64 -C qa --no-check
- 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
- 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: ninja system_webview_apk
run: |
cd src
ninja -C ${BUILD_DIR} system_webview_apk
- name: ninja system_webview_shell_apk
run: |
cd src
ninja -C ${BUILD_DIR} system_webview_shell_apk
- name: ninja monochrome_public_apk
run: |
cd src
ninja -C ${BUILD_DIR} monochrome_public_apk
- name: ninja trichrome_webview_apk
run: |
cd src
ninja -C ${BUILD_DIR} trichrome_webview_apk
- name: sccache check
run: sccache -s
- name: Any speed
run: echo Any speed
- name: Check for apks
run: |
cd src
find ${BUILD_DIR} -type f -iname "*.apk"
- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: APKs
path: |
src/out/android-arm64_qa/apks/*.apk
27 changes: 27 additions & 0 deletions .github/workflows/linux.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: linux

on:
pull_request:
types: [opened, reopened, synchronize, labeled]
branches:
- 'dev/m114_ci'
push:
branches:
- 'dev/m114_ci'
workflow_dispatch:
inputs:
nightly:
description: 'Nightly workflow.'
required: true
type: boolean
default: false

jobs:
linux-x64:
uses: ./.github/workflows/main.yaml
permissions:
packages: write
pull-requests: write
with:
platform: linux
nightly: ${{ github.event.inputs.nightly }}
Loading
Loading