diff --git a/.github/workflows/build-tests.yaml b/.github/workflows/build-tests.yaml deleted file mode 100644 index 9904635..0000000 --- a/.github/workflows/build-tests.yaml +++ /dev/null @@ -1,176 +0,0 @@ -name: Build Tests -permissions: - actions: none - checks: none - contents: none - deployments: none - issues: none - packages: none - pull-requests: none - repository-projects: none - security-events: none - statuses: none - -on: - workflow_dispatch: - inputs: - sha: - description: 'uazo/bromite SHA' - required: true - default: '76745fde6ed75542f005ea5528f486df41c56da4' - -env: - BROMITE_SHA: ${{ github.event.inputs.sha }} - REMOVEDOCKERSUPPORT: true - USELOCALIMAGE: true - GOMAJOBS: 60 - -jobs: - build-test: - runs-on: self-hosted - if: success() - - services: - gomaserver: - image: uazo/goma-server - volumes: - - /tmp/proxy:/tmp/proxy - - /redis:/var/lib/redis - options: >- - --health-cmd "hostname -I >/tmp/proxy/gomaserverip" - --health-interval 30s - --health-timeout 5s - --health-retries 5 - - env: - REMOVEDOCKERSUPPORT: true - USELOCALIMAGE: true - - container: - image: uazo/bromite-build:build - env: - SERVER_HOST_GOMA: gomaserver - REMOVEDOCKERSUPPORT: true # CUSTOM RUNNER: remove sharing of docker socket - USELOCALIMAGE: true # CUSTOM RUNNER: permit use of local images - USEINTERNALNETWORK: true # CUSTOM RUNNER: create the docker network as internal - WORKSPACE: /home/lg/working_dir - ARTIFACS_DIR: /home/lg/working_dir/artifacs - volumes: - - /storage/images/${{ github.event.inputs.sha }}:/home/lg/working_dir/artifacs - - /tmp/proxy:/tmp/proxy - - steps: - - name: Prepare Build Container - shell: bash - run: | - # set workspace paths - PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH - cd $WORKSPACE - - # copy artifacts - sudo chmod 777 $ARTIFACS_DIR - cp -arp $ARTIFACS_DIR/out out/bromite - - # reset proxy env - HTTP_PROXY= - HTTPS_PROXY= - http_proxy= - https_proxy= - - # update hosts - #sudo echo "$(cat /tmp/proxy/gomaserverip | xargs) gomaserver" >/etc/hosts - #sudo echo "$(cat /tmp/proxy/redisip | xargs) redis" >/etc/hosts - - # set goma options - export SERVER_HOST_GOMA=$(cat /tmp/proxy/gomaserverip | xargs) - export GOMA_SERVER_HOST=$SERVER_HOST_GOMA - export GOMA_SERVER_PORT=5050 - export GOMA_USE_SSL=false - export GOMA_HTTP_AUTHORIZATION_FILE=$WORKSPACE/.debug_auth_file - export GOMA_HERMETIC=error - export GOMA_USE_LOCAL=false - export GOMA_FALLBACK=true - export GOMA_ARBITRARY_TOOLCHAIN_SUPPORT=true - - # start goma client - echo "::group::-------- start goma client" - $WORKSPACE/goma/goma_ctl.py ensure_stop - $WORKSPACE/goma/goma_ctl.py ensure_start - echo "::endgroup::" - - cd chromium/src - - if [[ -z "${GOMAJOBS}" ]]; then - GOMAJOBS=40 - fi - - echo "::group::-------- pre-cache toolchain" - sudo ../../casupload --cas-server=unix:/tmp/proxy/bots.sock --instance=default_instance \ - third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include \ - third_party/android_ndk/toolchains/llvm/prebuilt/linux-x86_64/include \ - third_party/llvm-build/Release+Asserts/lib \ - third_party/llvm-build/Release+Asserts/bin \ - buildtools/third_party/libc++ \ - chrome/android/profiles/afdo.prof - echo "::endgroup::" - - - name: Build junit tests - shell: bash - run: | - PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH - cd $WORKSPACE/chromium/src - - autoninja -j $GOMAJOBS -C out/bromite chrome_junit_tests - autoninja -j $GOMAJOBS -C out/bromite components_junit_tests - autoninja -j $GOMAJOBS -C out/bromite content_junit_tests - autoninja -j $GOMAJOBS -C out/bromite base_junit_tests - autoninja -j $GOMAJOBS -C out/bromite ui_junit_tests - - - name: Build c++ tests - shell: bash - run: | - PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH - cd $WORKSPACE/chromium/src - - autoninja -j $GOMAJOBS -C out/bromite network_service - autoninja -j $GOMAJOBS -C out/bromite unit_tests - autoninja -j $GOMAJOBS -C out/bromite content_browsertests - autoninja -j $GOMAJOBS -C out/bromite components_unittests - - - name: Build instrumentation tests - shell: bash - run: | - PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH - cd $WORKSPACE/chromium/src - - autoninja -j $GOMAJOBS -C out/bromite content_shell_test_apk - autoninja -j $GOMAJOBS -C out/bromite chrome_public_test_apk - - - name: Sync out folder - shell: bash - run: | - PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH - cd $WORKSPACE/chromium/src - - echo "::group::-------- sync out folder" - $WORKSPACE/mtool/chromium/mtime.sh --backup - mv .mtool out/bromite/ - cp -arp out/bromite $ARTIFACS_DIR/out - echo "::endgroup::" - - - name: Wait forever - shell: bash - run: | - sleep infinity - - - name: Stop goma - shell: bash - run: | - PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH - cd $WORKSPACE/chromium/src - - echo "::group::-------- stop goma" - $WORKSPACE/goma/goma_ctl.py ensure_stop - find /tmp/ -maxdepth 1 -name "gomacc*" -print0 | xargs -0 rm - rm -rf /tmp/goma_lg/ - echo "::endgroup::" diff --git a/.github/workflows/execute-tests.yaml b/.github/workflows/execute-tests.yaml new file mode 100644 index 0000000..053d8d2 --- /dev/null +++ b/.github/workflows/execute-tests.yaml @@ -0,0 +1,91 @@ +name: Execute Tests +permissions: + actions: none + checks: none + contents: none + deployments: none + issues: none + packages: none + pull-requests: none + repository-projects: none + security-events: none + statuses: none + +on: + workflow_dispatch: + inputs: + sha: + description: 'uazo/bromite SHA' + required: true + default: 'ce2f07034a3d3b257e9bada65d8293a6786bb95f' + +env: + BROMITE_SHA: ${{ github.event.inputs.sha }} + REMOVEDOCKERSUPPORT: true + USELOCALIMAGE: true + +jobs: + get_image: + runs-on: self-hosted + steps: + - name: Mark image to test + shell: bash + run: | + docker tag uazo/bromite-build:$BROMITE_SHA uazo/bromite-build:test + + exec-test: + runs-on: self-hosted + container: + image: uazo/bromite-build:test + env: + REMOVEDOCKERSUPPORT: true # CUSTOM RUNNER: remove sharing of docker socket + USELOCALIMAGE: true # CUSTOM RUNNER: permit use of local images + USEINTERNALNETWORK: true # CUSTOM RUNNER: create the docker network as internal + WORKSPACE: /home/lg/working_dir + ARTIFACS_DIR: /home/lg/working_dir/artifacs + volumes: + - /storage/images/${{ github.event.inputs.sha }}:/home/lg/working_dir/artifacs + + steps: + - name: Prepare Test Container + shell: bash + run: | + # set workspace paths + PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH + cd $WORKSPACE + + # copy artifacts + cd chromium/src + mkdir -p out/bromite + cp -arp $ARTIFACS_DIR/out out/bromite + + # reset proxy env + HTTP_PROXY= + HTTPS_PROXY= + http_proxy= + https_proxy= + + - name: Wait forever + shell: bash + run: | + sleep infinity + + - name: Execute junit tests + shell: bash + run: | + PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH + cd $WORKSPACE/chromium/src + + out/bromite/bin/run_chrome_junit_tests | tee ~/chrome_junit_tests.log + out/bromite/bin/run_components_junit_tests | tee ~/components_junit_tests.log + out/bromite/bin/run_content_junit_tests | tee ~/content_junit_tests.log + out/bromite/bin/run_base_junit_tests | tee ~/base_junit_tests.log + out/bromite/bin/run_ui_junit_tests | tee ~/ui_junit_tests.log + + - name: Execute c++ tests + shell: bash + run: | + PATH=$WORKSPACE/chromium/src/third_party/llvm-build/Release+Asserts/bin:$WORKSPACE/depot_tools/:/usr/local/go/bin:$WORKSPACE/mtool/bin:$PATH + cd $WORKSPACE/chromium/src + + #out/bromite/bin/run_content_browsertests --avd-config tools/android/avd/proto/generic_android28.textpb | tee ~/content_browsertests.log