Merge pull request #6384 from reitermarkus/docker

Try caching the Docker image.
This commit is contained in:
Markus Reiter 2019-08-21 09:59:09 +02:00 committed by GitHub
commit 94233cf4e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 28 deletions

View File

@ -23,7 +23,9 @@ jobs:
if: matrix.os == 'macOS-latest'
- name: Build Docker image
run: docker-compose -f Dockerfile.yml build sut
run: |
docker pull linuxbrew/brew
docker-compose -f Dockerfile.yml build sut
if: matrix.os == 'ubuntu-latest'
- name: Run brew test-bot

View File

@ -26,6 +26,7 @@ RUN localedef -i en_US -f UTF-8 en_US.UTF-8 \
&& useradd -m -s /bin/bash linuxbrew \
&& echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers
ADD . /home/linuxbrew/.linuxbrew/Homebrew
ARG FORCE_REBUILD
RUN cd /home/linuxbrew/.linuxbrew \
&& mkdir -p bin etc include lib opt sbin share var/homebrew/linked Cellar \
&& ln -s ../Homebrew/bin/brew /home/linuxbrew/.linuxbrew/bin/ \

View File

@ -1,27 +1,35 @@
sut:
build: .
command:
- sh
- -xc
- |
/home/linuxbrew/.linuxbrew/bin/brew test-bot
status=$$?
exit $$status
environment:
# GitHub Actions
- GITHUB_ACTIONS
- GITHUB_BASE_REF
- GITHUB_EVENT_NAME
- GITHUB_REF
- GITHUB_REPOSITORY
- GITHUB_SHA
- HEAD_GITHUB_REF
# Azure Pipelines
- BUILD_REASON
- BUILD_REPOSITORY_URI
- BUILD_SOURCEVERSION
- SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
- SYSTEM_PULLREQUEST_TARGETBRANCH
- TF_BUILD
# GitHub API
- HOMEBREW_GITHUB_API_TOKEN
version: '3.7'
services:
sut:
build:
context: .
cache_from:
- linuxbrew/brew
args:
- FORCE_REBUILD=1
command:
- sh
- -xc
- |
/home/linuxbrew/.linuxbrew/bin/brew test-bot
status=$$?
exit $$status
environment:
# GitHub Actions
- GITHUB_ACTIONS
- GITHUB_BASE_REF
- GITHUB_EVENT_NAME
- GITHUB_REF
- GITHUB_REPOSITORY
- GITHUB_SHA
- HEAD_GITHUB_REF
# Azure Pipelines
- BUILD_REASON
- BUILD_REPOSITORY_URI
- BUILD_SOURCEVERSION
- SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
- SYSTEM_PULLREQUEST_TARGETBRANCH
- TF_BUILD
# GitHub API
- HOMEBREW_GITHUB_API_TOKEN