Browse Source

Add matrix; Add retry for docker-machine failure

master
wchen342 2 years ago
parent
commit
57cac8650e
Signed by untrusted user: wchen342 GPG Key ID: 720B70365E800508
  1. 105
      .github/workflows/build-monochrome-arm.yml
  2. 13
      .github/workflows/build.yml

105
.github/workflows/build-monochrome-arm.yml

@ -1,105 +0,0 @@
name: Ungoogled-chromium-android MonoChromePublic arm build
on: [push, pull_request, repository_dispatch]
jobs:
build:
env:
container_name: archlinuxlatest_47dabf
XHYVE_CPU_COUNT: 4
XHYVE_MEMORY_SIZE: 11264
XHYVE_DISK_SIZE: 30000
name: Build Chromium Android
runs-on: macos-latest
steps:
- name: Check Environment
run: |
pwd
uname -r
system_profiler SPHardwareDataType
- name: Checkout repository
uses: actions/[email protected]
- name: Checkout submodules
run: |
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
git submodule sync --recursive
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
- name: Install Docker
run: |
brew install docker docker-compose docker-machine xhyve docker-machine-driver-xhyve
# brew cask install virtualbox
sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
brew services start docker-machine
brew cleanup -s && rm -rf $(brew --cache)
- name: Create Docker Machine
run: |
mkdir -p ~/.docker/machine/cache
curl -Lo ~/.docker/machine/cache/boot2docker.iso https://github.com/boot2docker/boot2docker/releases/download/v19.03.5/boot2docker.iso
docker-machine create --driver xhyve default
docker-machine ssh default pwd
docker-machine ssh default id -un
docker-machine ssh default mkdir -p /home/docker/work/_temp /home/docker/work/_actions /home/docker/work/_temp/_github_home /home/docker/work/_temp/_github_workflow
- name: Start Docker
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker version --format '{{.Server.APIVersion}}'
docker version --format '{{.Client.APIVersion}}'
docker ps --all --quiet --no-trunc --filter "label=488dfb"
docker network prune --force --filter "label=488dfb"
docker network create --label 488dfb github_network_28ec84219b9a42c98a67ea807a1d376e
docker pull archlinux:latest
docker volume create --name ${container_name}_local_volume
docker create --name ${container_name} --cap-add SYS_MODULE --cap-add SYS_ADMIN --device /dev/fuse --label 488dfb --workdir /__w/ungoogled-chromium-android/ungoogled-chromium-android --network github_network_28ec84219b9a42c98a67ea807a1d376e -e "HOME=/github/home" -e GITHUB_ACTIONS=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/lib/modules":"/lib/modules" -v "${container_name}_local_volume":"/__w" -v "/home/docker/work/_temp":"/__w/_temp" -v "/home/docker/work/_actions":"/__w/_actions" -v "/home/docker/work/_temp/_github_home":"/github/home" -v "/home/docker/work/_temp/_github_workflow":"/github/workflow" --entrypoint "tail" archlinux:latest "-f" "/dev/null"
docker ps --all
docker inspect --format "{{range .Config.Env}}{{println .}}{{end}}" ${container_name}
docker start ${container_name}
- name: Install dependencies
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker exec ${container_name} bash -c 'sed -i "$(($(grep -n "\[multilib\]" /etc/pacman.conf | cut -f1 -d:) + 1))s/^#//g" /etc/pacman.conf' # Seems to be enabled by deafult in arch docker image?
docker exec ${container_name} pacman -Sy --noconfirm
docker exec ${container_name} pacman -S --noconfirm lib32-glibc multilib-devel
docker exec ${container_name} pacman -S --noconfirm gnu-free-fonts jdk8-openjdk
docker exec ${container_name} pacman -S --noconfirm --needed base base-devel json-glib libva protobuf jsoncpp python python2 gperf wget rsync tar unzip curl gnupg maven yasm mesa npm ninja git clang lld gn llvm quilt
docker exec ${container_name} bash -c 'yes | pacman -Scc'
- name: Move repository
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker-machine scp -r ../ungoogled-chromium-android [email protected]:/home/docker/work/_temp/_github_home
docker exec ${container_name} bash -c 'cp -r ${HOME}/ungoogled-chromium-android .'
- name: Install python environment
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker exec ${container_name} wget "https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh"
docker exec ${container_name} bash -c 'echo "bfe34e1fa28d6d75a7ad05fd02fa5472275673d5f5621b77380898dee1be15d2 Miniconda3-latest-Linux-x86_64.sh" | sha256sum --check --status'
docker exec ${container_name} chmod +x Miniconda3-latest-Linux-x86_64.sh
docker exec ${container_name} bash -c './Miniconda3-latest-Linux-x86_64.sh -b -p ~/anaconda && rm -rf Miniconda3-latest-Linux-x86_64.sh'
docker exec ${container_name} bash -c 'source ~/anaconda/bin/activate && conda init && conda create -y --name py2 python=2 && conda activate py2 && pip install six'
- name: Build
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker exec ${container_name} bash -c 'source ~/.bashrc && conda activate py2 && cd ungoogled-chromium-android && ./build.sh -a arm -t monochrome_public_apk'
docker exec ${container_name} bash -c 'ls ungoogled-chromium-android/src/out/Default/apks'
- name: Move artifact
env:
SUMS: checksums.txt
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker exec ${container_name} bash -c 'mkdir ${HOME}/artifact && cp ungoogled-chromium-android/src/out/Default/apks/*.apk ${HOME}/artifact'
docker-machine scp -r [email protected]:/home/docker/work/_temp/_github_home/artifact ..
ls -la ..
cd ../artifact
openssl sha256 *.apk > $SUMS
cat $SUMS
- uses: actions/[email protected]
name: Upload artifact
with:
name: Ungoogled-chromium-android
path: ../artifact/

13
.github/workflows/build-chrome-arm64.yml → .github/workflows/build.yml

@ -10,13 +10,22 @@ jobs:
XHYVE_DISK_SIZE: 30000
name: Build Chromium Android
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
arch: [arm, arm64]
target: [chrome_public_apk, monochrome_public_apk]
steps:
- name: Stop if Monochrome+arm64
if: matrix.arch == 'arm64' && matrix.target == 'monochrome_public_apk'
run: exit 1 # Is there a better way to stop?
- name: Check Environment
run: |
pwd
uname -r
system_profiler SPHardwareDataType
sleep $((10 + RANDOM % 20))
- name: Checkout repository
uses: actions/[email protected]
- name: Checkout submodules
@ -36,7 +45,7 @@ jobs:
run: |
mkdir -p ~/.docker/machine/cache
curl -Lo ~/.docker/machine/cache/boot2docker.iso https://github.com/boot2docker/boot2docker/releases/download/v19.03.5/boot2docker.iso
docker-machine create --driver xhyve default
for i in $(seq 1 5); do docker-machine create --driver xhyve default && s=0 && break || s=$? && docker-machine rm -f default && sleep 15; done; (exit $s) # Retry 5 times in case of failure
docker-machine ssh default pwd
docker-machine ssh default id -un
docker-machine ssh default mkdir -p /home/docker/work/_temp /home/docker/work/_actions /home/docker/work/_temp/_github_home /home/docker/work/_temp/_github_workflow
@ -84,7 +93,7 @@ jobs:
run: |
docker-machine env default
eval "$(docker-machine env default)"
docker exec ${container_name} bash -c 'source ~/.bashrc && conda activate py2 && cd ungoogled-chromium-android && ./build.sh -a arm64 -t chrome_public_apk'
docker exec ${container_name} bash -c 'source ~/.bashrc && conda activate py2 && cd ungoogled-chromium-android && ./build.sh -a ${{ matrix.arch }} -t ${{ matrix.target }}'
docker exec ${container_name} bash -c 'ls ungoogled-chromium-android/src/out/Default/apks'
- name: Move artifact
env:
Loading…
Cancel
Save