-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
3 additions
and
244 deletions.
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 |
---|---|---|
|
@@ -150,188 +150,9 @@ jobs: | |
evergreen_loader: ${{ env.evergreen_loader }} | ||
docker_service: ${{ env.docker_service }} | ||
|
||
# Builds, tags, and pushes Cobalt docker build images to ghr. | ||
docker-build-image: | ||
needs: [initialize] | ||
runs-on: [self-hosted, linux-runner] | ||
permissions: | ||
packages: write | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout files | ||
uses: kaidokert/[email protected] | ||
timeout-minutes: 30 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
- name: Login to Docker Registry ${{env.REGISTRY}} | ||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build docker image | ||
id: build-docker-image | ||
uses: ./.github/actions/docker | ||
with: | ||
docker_service: ${{ needs.initialize.outputs.docker_service }} | ||
docker_image: cobalt-${{ needs.initialize.outputs.docker_service }} | ||
- name: Set Docker Tag Output | ||
id: set-docker-tag-output | ||
shell: bash | ||
run: | | ||
set -u | ||
echo $DOCKER_TAG | ||
echo "docker_tag=$DOCKER_TAG" | head -n 1 >> $GITHUB_ENV | ||
outputs: | ||
docker_tag: ${{env.docker_tag}} | ||
|
||
# Builds, tags, and pushes Cobalt unit test image to ghr. | ||
docker-unittest-image: | ||
if: needs.initialize.outputs.on_host_test == 'true' | ||
needs: [initialize] | ||
permissions: | ||
packages: write | ||
runs-on: [self-hosted, linux-runner] | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout files | ||
uses: kaidokert/[email protected] | ||
timeout-minutes: 30 | ||
with: | ||
fetch-depth: 2 | ||
persist-credentials: false | ||
- name: Login to Docker Registry ${{env.REGISTRY}} | ||
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a # v2.1.0 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build docker image | ||
id: build-docker-image | ||
uses: ./.github/actions/docker | ||
with: | ||
docker_service: linux-x64x11-unittest | ||
docker_image: cobalt-linux-x64x11-unittest | ||
- name: Set Docker Tag Output | ||
id: set-docker-unittest-tag-output | ||
shell: bash | ||
run: | | ||
set -u | ||
echo $DOCKER_TAG | ||
echo "docker_unittest_tag=$DOCKER_TAG" >> $GITHUB_ENV | ||
outputs: | ||
docker_unittest_tag: ${{env.docker_unittest_tag}} | ||
|
||
# Runs builds. | ||
build: | ||
needs: [initialize, docker-build-image] | ||
permissions: {} | ||
runs-on: [self-hosted, linux-runner] | ||
name: ${{matrix.name}}_${{matrix.config}} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: ${{ fromJson(needs.initialize.outputs.platforms) }} | ||
include: ${{ fromJson(needs.initialize.outputs.includes) }} | ||
config: [devel, debug, qa, gold] | ||
container: ${{ needs.docker-build-image.outputs.docker_tag }} | ||
env: | ||
# We want temp folder to be on tmpfs which makes workloads faster. | ||
# However, dind container ends up having / folder mounted on overlay | ||
# filesystem, whereas /__w which contains Cobalt source code is on tmpfs. | ||
TMPDIR: /__w/_temp | ||
timeout-minutes: 60 | ||
steps: | ||
- name: Checkout | ||
uses: kaidokert/[email protected] | ||
timeout-minutes: 30 | ||
with: | ||
# Use fetch depth of 0 to get full history for a valid build id. | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
- name: Cache Gradle | ||
uses: actions/cache@v3 | ||
if: startsWith(matrix.target_platform, 'android') || startsWith(needs.initialize.outputs.evergreen_loader, 'android') | ||
with: | ||
key: gradle-cache-${{ hashFiles('starboard/android/apk/**/*gradle*') }} | ||
path: | | ||
/root/.gradle/caches | ||
/root/.gradle/wrapper | ||
- name: GN | ||
uses: ./.github/actions/gn | ||
- name: Build Cobalt | ||
uses: ./.github/actions/build | ||
- name: 'Check Artifact Size' | ||
uses: ./.github/actions/check_artifact_size | ||
if: ${{ inputs.artifact_size_increase_thresholds }} | ||
with: | ||
workflow: ${{ github.workflow }} | ||
name: ${{ matrix.platform }}-${{ matrix.config }} | ||
path: out/${{ matrix.target_platform }}_${{ matrix.config }} | ||
thresholds: ${{ inputs.artifact_size_increase_thresholds }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
- name: 'Upload Artifact' | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ inputs.keep_artifacts }} | ||
with: | ||
name: ${{ matrix.platform }}-${{ matrix.config }} | ||
path: out/${{ matrix.target_platform }}_${{ matrix.config }}/${{ inputs.keep_artifacts }} | ||
retention-days: 7 | ||
compression-level: 0 # We expect kept artifacts to be already compressed | ||
if-no-files-found: error | ||
- name: Run API Leak Detector | ||
uses: ./.github/actions/api_leak_detector | ||
if: inputs.run_api_leak_detector | ||
with: | ||
relative_manifest_path: ${{ inputs.leak_manifest_filename }} | ||
- name: Upload On Host Test Artifacts | ||
if: ${{ matrix.config == 'devel' && needs.initialize.outputs.on_host_test == 'true' }} | ||
uses: ./.github/actions/upload_test_artifacts | ||
with: | ||
type: onhost | ||
os: linux | ||
# For some reason passing needs.initialize.outputs.evergreen_loader as parameter to build | ||
# action didn't work, so instead we set an env var. | ||
- name: Set Evergreen loader config | ||
if: ${{ needs.initialize.outputs.evergreen_loader != 'null' }} | ||
shell: bash | ||
run: | | ||
set -u | ||
COBALT_EVERGREEN_LOADER="${{needs.initialize.outputs.evergreen_loader}}" | ||
echo "COBALT_EVERGREEN_LOADER=${COBALT_EVERGREEN_LOADER}" >> $GITHUB_ENV | ||
# Build Evergreen loader for on-host tests if necessary. | ||
- name: Evergreen loader GN | ||
if: ${{ needs.initialize.outputs.evergreen_loader != 'null' && ( matrix.config == 'devel' || matrix.config == 'qa' ) }} | ||
uses: ./.github/actions/gn | ||
- name: Build Evergreen loader | ||
if: ${{ needs.initialize.outputs.evergreen_loader != 'null' && ( matrix.config == 'devel' || matrix.config == 'qa' ) }} | ||
uses: ./.github/actions/build | ||
- name: Upload Nightly Artifacts | ||
if: ${{ ( inputs.nightly == 'true' || github.event_name == 'schedule' ) && matrix.config != 'debug' }} | ||
uses: ./.github/actions/upload_nightly_artifacts | ||
- name: Upload Evergreen loader On Host Test Artifacts | ||
if: ${{ needs.initialize.outputs.evergreen_loader != 'null' && matrix.config == 'devel' && needs.initialize.outputs.on_host_test == 'true'}} | ||
uses: ./.github/actions/upload_test_artifacts | ||
with: | ||
type: onhost | ||
os: linux | ||
- name: Upload On Device Test Artifacts | ||
if: | | ||
matrix.config == 'devel' && | ||
fromJSON(needs.initialize.outputs.on_device_test).enabled == true && | ||
( | ||
github.event_name != 'pull_request' || | ||
contains(github.event.pull_request.labels.*.name, 'on_device') | ||
) | ||
uses: ./.github/actions/upload_test_artifacts | ||
with: | ||
type: ondevice | ||
os: linux | ||
|
||
# Runs on-device integration and unit tests. | ||
on-device-test: | ||
needs: [initialize, build] | ||
needs: [initialize] | ||
# Run ODT when on_device label is applied on PR. | ||
# Also, run ODT on push and schedule if not explicitly disabled via repo vars. | ||
if: | | ||
|
@@ -364,38 +185,3 @@ jobs: | |
persist-credentials: false | ||
- name: Run Tests (${{ matrix.shard }}) | ||
uses: ./.github/actions/on_device_tests | ||
|
||
# Runs on-host integration and unit tests. | ||
on-host-test: | ||
needs: [initialize, docker-unittest-image, build] | ||
permissions: {} | ||
if: needs.initialize.outputs.on_host_test == 'true' | ||
runs-on: [self-hosted, linux-runner] | ||
name: ${{matrix.name}}_${{matrix.shard}}_test | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
platform: ${{ fromJson(needs.initialize.outputs.platforms) }} | ||
shard: ${{ fromJson(needs.initialize.outputs.on_host_test_shards) }} | ||
config: [devel] | ||
include: ${{ fromJson(needs.initialize.outputs.includes) }} | ||
container: ${{ needs.docker-unittest-image.outputs.docker_unittest_tag }} | ||
env: | ||
DISPLAY: :99 | ||
# For some reason tests complaining about HOME set to /github/home | ||
# with permission denied error. | ||
HOME: /root | ||
COBALT_EVERGREEN_LOADER: ${{needs.initialize.outputs.evergreen_loader}} | ||
MODULAR_BUILD: ${{ inputs.modular && 1 || 0 }} | ||
timeout-minutes: 90 | ||
steps: | ||
- name: Checkout | ||
uses: kaidokert/[email protected] | ||
timeout-minutes: 30 | ||
with: | ||
fetch-depth: 1 | ||
persist-credentials: false | ||
- name: Run Tests | ||
uses: ./.github/actions/on_host_test | ||
with: | ||
os: linux |