Skip to content
Closed
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
526 changes: 526 additions & 0 deletions .github/workflows/bs_meta_browser_build_and_test.yml

Large diffs are not rendered by default.

156 changes: 156 additions & 0 deletions .github/workflows/bs_meta_browser_ci_ec2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
name: 'BrightSign Build and Test Meta-Browser: EC2 controller'
on:
workflow_call:
inputs:
build_type:
description: 'Build Type'
required: true
type: string

browser:
description: 'Chromium or Electron'
required: true
type: string

yocto_version:
description: 'Yocto version'
required: true
type: string

chromium_version:
description: 'Display backend/Ozone platform (ozone-wayland or x11)'
required: true
type: string

libc_flavour:
description: 'libc flavour'
required: true
type: string

arch:
description: 'Architecture'
required: true
type: string

instance_type:
description: 'EC2 instance type'
required: false
type: string
default: c6a.4xlarge

leave_ec2_instance_running:
description: 'Leave EC2 instance running after use'
type: boolean
default: false

instance_name_postfix:
description: 'Name to add as postfix to the EC2 machine'
type: string
default: auto-triggered

aws_arn_role:
required: true
type: string

aws_region:
required: true
type: string

jobs:
start-runner:
name: Start self-hosted EC2 runner
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ inputs.aws_region }}
role-to-assume: ${{ inputs.aws_arn_role }}
role-session-name: mb-ci-${{ github.run_id }}
role-duration-seconds: 43200 # 12 hours for long builds

- name: Download config file and set env vars from it
run: |
aws s3 cp s3://meta-browser-ci-config-bucket/config.json .
aws s3 cp s3://meta-browser-ci-config-bucket/set_github_env_vars.py .
python3 set_github_env_vars.py --file config.json

- name: Clean up any leftover runners
run: |
echo "Checking for any leftover runners from previous runs..."
# This is informational only - the action will handle unique labels
echo "Current GitHub run context:"
echo "Run ID: ${{ github.run_id }}"
echo "Run attempt: ${{ github.run_attempt }}"
echo "Run number: ${{ github.run_number }}"

- name: Start EC2 runner with retry
id: start-ec2-runner
uses: brightsign/ec2-github-runner@0fa8b183dd4124fd191ccdbc48b68f0ea46a9634
timeout-minutes: 15 # Allow more time for registration
with:
mode: start
github-app-private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
github-app-id: 287690
ec2-image-id: ami-08a4255385679596c # Custom AMI with Yocto build dependencies pre-installed
ec2-instance-type: ${{ inputs.instance_type }}
subnet-id: ${{ env.VPC_SUBNET_ID }}
security-group-id: ${{ env.VPC_SG_ID }}
run-as-service-with-user: ubuntu
label: "mb-${{ github.run_id }}-${{ inputs.browser }}-${{ inputs.arch }}-${{ inputs.chromium_version }}" # Unique per matrix job
aws-resource-tags: > # optional, requires additional permissions
[
{"Key": "Name", "Value": "github-runner-meta-browser-${{ inputs.instance_name_postfix }}-${{ github.run_id }}"},
{"Key": "GitHubRepository", "Value": "${{ github.repository }}"},
{"Key": "YoctoVersion", "Value": "${{ inputs.yocto_version }}"},
{"Key": "ChromiumVersion", "Value": "${{ inputs.chromium_version }}"},
{"Key": "Architecture", "Value": "${{ inputs.arch }}"},
{"Key": "RunId", "Value": "${{ github.run_id }}"},
{"Key": "RunAttempt", "Value": "${{ github.run_attempt }}"},
{"Key": "Browser", "Value": "${{ inputs.browser }}"}
]

build-and-test-meta-browser:
name: Build and Test Meta-Browser
needs: start-runner # required to start the main job when the runner is ready
uses: ./.github/workflows/bs_meta_browser_build_and_test.yml
secrets: inherit
with:
runner_name: ${{ needs.start-runner.outputs.label }} # run the job on the newly created runner
github_hosted_runner: false
browser: ${{ inputs.browser }}
build_type: ${{ inputs.build_type }}
yocto_version: ${{ inputs.yocto_version }}
chromium_version: ${{ inputs.chromium_version }}
libc_flavour: ${{ inputs.libc_flavour }}
arch: ${{ inputs.arch }}
aws_arn_role: ${{ inputs.aws_arn_role }}
aws_region: ${{ inputs.aws_region }}

stop-runner:
name: Stop self-hosted EC2 runner
needs:
- start-runner # required to get output from the start-runner job
- build-and-test-meta-browser # required to wait when the main job is done
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ inputs.aws_arn_role }}
aws-region: ${{ inputs.aws_region }}
role-session-name: mb-cleanup-${{ github.run_id }}

- name: Stop EC2 runner
uses: brightsign/ec2-github-runner@0fa8b183dd4124fd191ccdbc48b68f0ea46a9634
with:
mode: stop
github-app-private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
github-app-id: 287690
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}
leave-ec2-instance-running: ${{ inputs.leave_ec2_instance_running }}
102 changes: 102 additions & 0 deletions .github/workflows/chromium.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Chromium build- and smoke-test

on:
workflow_dispatch:
inputs:
repository:
description: 'Repository to clone for the workflow'
required: true
default: 'brightsign'
branch:
description: 'Branch to checkout for the workflow'
required: true
default: 'master'
use_aws:
description: 'Use AWS EC2 instances instead of local runner'
required: false
type: boolean
default: true
instance_type:
description: 'EC2 instance type for build (more cores = faster builds)'
required: false
type: choice
options:
- 'c6id.4xlarge' # 16 vCPUs, 32 GB RAM, 1x 950 GB NVMe
- 'c6id.8xlarge' # 32 vCPUs, 64 GB RAM, 1x 1900 GB NVMe
- 'c6id.12xlarge' # 48 vCPUs, 96 GB RAM, 2x 1425 GB NVMe
- 'c6id.16xlarge' # 64 vCPUs, 128 GB RAM, 2x 1900 GB NVMe
default: 'c6id.8xlarge'
pull_request:
branches:
- master
paths:
- 'meta-chromium/recipes-browser/chromium/files/**'
- 'meta-chromium/recipes-browser/chromium/chromium*'
- 'meta-chromium/recipes-browser/chromium/gn*'
- '.github/workflows/chromium.yml'

permissions:
contents: read
actions: read
checks: write
id-token: write # Required for OIDC authentication

jobs:
# AWS-based builds (always for PR, default for manual dispatch)
aws-matrix-build:
if: ${{ github.repository_owner == 'brightsign' && (github.event_name == 'pull_request' || inputs.use_aws == true || inputs.use_aws == null) }}
strategy:
fail-fast: false # Continue other matrix jobs even if one fails
matrix:
yocto_version: [scarthgap]
ozone_platform: [ozone-wayland, x11]
libc_flavour: [glibc]
arch: [arm, aarch64, x86-64]
uses: ./.github/workflows/bs_meta_browser_ci_ec2.yml
secrets: inherit
with:
build_type: "release"
browser: "chromium"
yocto_version: ${{ matrix.yocto_version }}
chromium_version: ${{ matrix.ozone_platform }}
libc_flavour: ${{ matrix.libc_flavour }}
arch: ${{ matrix.arch }}
aws_arn_role: "arn:aws:iam::195607249165:role/github-actions-meta-browser-repo"
aws_region: "us-east-1"
instance_type: ${{ inputs.instance_type || 'c6id.8xlarge' }} # Default for PR builds, user choice for manual

# Local runner (manual dispatch only, when explicitly disabled AWS)
local-build:
if: ${{ github.repository_owner == 'brightsign' && github.event_name == 'workflow_dispatch' && inputs.use_aws == false }}
strategy:
fail-fast: false # Continue other matrix jobs even if one fails
matrix:
yocto_version: [master]
browser_version: [ozone-wayland, x11]
browser: [chromium]
libc_flavour: [glibc]
arch: [arm, aarch64, x86-64]
runs-on: [self-hosted, chromium]
container:
image: skandigraun/yocto:latest
volumes:
- yocto:/yocto
steps:
- run: |
mkdir -p /yocto/${{ matrix.yocto_version }}
cd /yocto/${{ matrix.yocto_version }}
rm -rf meta-browser meta-chromium-test
# Clean stale pseudo state from any previous interrupted builds
rm -rf build/tmp/work/*/*/*/pseudo build/tmp/sysroots-components/*/pseudo 2>/dev/null || true
if [ "${{ github.event_name }}" = "pull_request" ]; then
GH_URL="$GITHUB_SERVER_URL/${{ github.event.pull_request.head.repo.full_name }}"
GH_REV="$GITHUB_HEAD_REF"
else
GH_URL="$GITHUB_SERVER_URL/${{ github.event.inputs.repository }}/meta-browser"
GH_REV="${{ github.event.inputs.branch }}"
fi
git clone $GH_URL
git -C meta-browser checkout $GH_REV
# clone the test repo
git clone -b scarthgap https://github.com/brightsign/meta-chromium-test.git
./meta-chromium-test/scripts/build.sh ${{ matrix.yocto_version}} ${{ matrix.arch }} ${{ matrix.browser_version }} ${{ matrix.browser }} ${{ matrix.libc_flavour}}
Loading
Loading