179 lines
5.8 KiB
YAML
179 lines
5.8 KiB
YAML
name: Build x86
|
|
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:
|
|
|
|
env:
|
|
BROMITE_SHA: 76745fde6ed75542f005ea5528f486df41c56da4
|
|
REMOVEDOCKERSUPPORT: true
|
|
USELOCALIMAGE: true
|
|
|
|
jobs:
|
|
check_images:
|
|
runs-on: self-hosted
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v2
|
|
with:
|
|
path: bromite-buildtools
|
|
fetch-depth: 1
|
|
|
|
- name: Get current proxy settings
|
|
shell: bash
|
|
run: |
|
|
if ! [[ -z "${HTTP_PROXY}" ]]; then
|
|
PROXY_ADDR=http://$(hostname -I | xargs):8118
|
|
echo "PROXY_ADDR=$PROXY_ADDR" >> $GITHUB_ENV
|
|
fi
|
|
|
|
- name: Get current chromium version
|
|
shell: bash
|
|
run: |
|
|
mkdir bromite
|
|
cd bromite
|
|
git init
|
|
git remote add origin https://github.com/uazo/bromite
|
|
git fetch origin $BROMITE_SHA
|
|
git reset --hard FETCH_HEAD
|
|
cd ..
|
|
|
|
export VERSION=$( cat ./bromite/build/RELEASE )
|
|
rm -rf bromite
|
|
|
|
echo Current version is $VERSION
|
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
|
|
|
cd bromite-buildtools
|
|
|
|
- name: Checking build-deps for ${{ env.VERSION }}
|
|
shell: bash
|
|
run: |
|
|
IS_PRESENT=$(docker inspect --type=image uazo/build-deps:$VERSION > /dev/null ; echo $?)
|
|
if [ $IS_PRESENT -ne "0" ]; then
|
|
IS_PRESENT=$(docker manifest inspect uazo/build-deps:$VERSION > /dev/null ; echo $?)
|
|
if [ $IS_PRESENT -ne "0" ]; then
|
|
DOCKER_BUILDKIT=1 docker build -t uazo/build-deps:$VERSION \
|
|
--progress plain \
|
|
--build-arg VERSION=$VERSION \
|
|
--build-arg HTTP_PROXY="$PROXY_ADDR" \
|
|
--no-cache \
|
|
bromite-buildtools/images/build-deps/.
|
|
fi
|
|
fi
|
|
|
|
- name: Checking chromium for ${{ env.VERSION }}
|
|
shell: bash
|
|
run: |
|
|
IS_PRESENT=$(docker inspect --type=image uazo/chromium:$VERSION > /dev/null ; echo $?)
|
|
if [ $IS_PRESENT -ne "0" ]; then
|
|
IS_PRESENT=$(docker manifest inspect uazo/chromium:$VERSION > /dev/null ; echo $?)
|
|
if [ $IS_PRESENT -ne "0" ]; then
|
|
DOCKER_BUILDKIT=1 docker build -t uazo/chromium:$VERSION \
|
|
--progress plain \
|
|
--build-arg VERSION=$VERSION \
|
|
--build-arg HTTP_PROXY="$PROXY_ADDR" \
|
|
bromite-buildtools/images/chr-source/.
|
|
fi
|
|
fi
|
|
|
|
- name: Checking bromite for ${{ env.BROMITE_SHA }}
|
|
shell: bash
|
|
run: |
|
|
IS_PRESENT=$(docker inspect --type=image uazo/bromite:$BROMITE_SHA > /dev/null ; echo $?)
|
|
if [ $IS_PRESENT -ne "0" ]; then
|
|
IS_PRESENT=$(docker manifest inspect uazo/bromite:$BROMITE_SHA > /dev/null ; echo $?)
|
|
if [ $IS_PRESENT -ne "0" ]; then
|
|
DOCKER_BUILDKIT=1 docker build -t uazo/bromite:$BROMITE_SHA --progress plain \
|
|
--build-arg BROMITE_SHA=$BROMITE_SHA \
|
|
--build-arg VERSION=$VERSION \
|
|
--build-arg HTTP_PROXY="$PROXY_ADDR" \
|
|
bromite-buildtools/images/bromite-source/.
|
|
fi
|
|
fi
|
|
|
|
- name: Checking bromite-build for ${{ env.BROMITE_SHA }}
|
|
shell: bash
|
|
run: |
|
|
IS_PRESENT=$(docker inspect --type=image uazo/bromite-build:$BROMITE_SHA > /dev/null ; echo $?)
|
|
if [ $IS_PRESENT -ne "0" ]; then
|
|
IS_PRESENT=$(docker manifest inspect uazo/bromite-build:$BROMITE_SHA > /dev/null ; echo $?)
|
|
if [ $IS_PRESENT -ne "0" ]; then
|
|
DOCKER_BUILDKIT=1 docker build -t uazo/bromite-build:$BROMITE_SHA --progress plain \
|
|
--build-arg BROMITE_SHA=$BROMITE_SHA \
|
|
--build-arg HTTP_PROXY="$PROXY_ADDR" \
|
|
--no-cache \
|
|
bromite-buildtools/images/bromite-build/.
|
|
fi
|
|
fi
|
|
|
|
build:
|
|
runs-on: self-hosted
|
|
needs: check_images
|
|
if: success()
|
|
|
|
services:
|
|
redis:
|
|
image: redis
|
|
options: >-
|
|
--health-cmd "redis-cli ping"
|
|
--health-interval 10s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
env:
|
|
REMOVEDOCKERSUPPORT: true
|
|
USELOCALIMAGE: true
|
|
|
|
gomaserver:
|
|
image: uazo/goma-server
|
|
#ports:
|
|
# - 5050:5050
|
|
volumes:
|
|
- /tmp/proxy:/tmp/proxy
|
|
options: >-
|
|
--health-cmd "hostname -I >/tmp/proxy/gomaserverip"
|
|
--health-interval 30s
|
|
--health-timeout 5s
|
|
--health-retries 5
|
|
|
|
env:
|
|
REDISHOST: redis
|
|
REMOTEEXEC_ADDR: ${{ secrets.REMOTEEXEC_ADDR }}
|
|
REMOVEDOCKERSUPPORT: true
|
|
USELOCALIMAGE: true
|
|
|
|
container:
|
|
image: uazo/bromite-build:76745fde6ed75542f005ea5528f486df41c56da4 #${{ env.BROMITE_SHA }}
|
|
env:
|
|
SERVER_HOST_GOMA: gomaserver
|
|
REMOVEDOCKERSUPPORT: true
|
|
USELOCALIMAGE: true
|
|
volumes:
|
|
- /storage/bromite/${{ github.sha }}:/home/lg/working_dir/artifacs
|
|
- /tmp/proxy:/tmp/proxy
|
|
|
|
steps:
|
|
- name: Build Bromite
|
|
shell: bash
|
|
env:
|
|
GOMAJOBS: 60
|
|
run: |
|
|
export WORKSPACE=/home/lg/working_dir
|
|
cd $WORKSPACE
|
|
|
|
export SERVER_HOST_GOMA=$(cat /tmp/proxy/gomaserverip | xargs)
|
|
# get goma internal server ip
|
|
# SERVER_HOST_GOMA=$(docker inspect -f '{{.Config.Image}}={{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq) | grep goma-server | sed 's/[^=]*=\(.*\)/\1/' | xargs)
|
|
|
|
./start-build.sh
|