Try caching the Docker image.

This commit is contained in:
Markus Reiter 2019-08-19 19:18:09 +02:00
parent 84c5f40793
commit 85968040b1
3 changed files with 39 additions and 28 deletions

View File

@ -23,7 +23,9 @@ jobs:
if: matrix.os == 'macOS-latest' if: matrix.os == 'macOS-latest'
- name: Build Docker image - 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' if: matrix.os == 'ubuntu-latest'
- name: Run brew test-bot - 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 \ && useradd -m -s /bin/bash linuxbrew \
&& echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers && echo 'linuxbrew ALL=(ALL) NOPASSWD:ALL' >>/etc/sudoers
ADD . /home/linuxbrew/.linuxbrew/Homebrew ADD . /home/linuxbrew/.linuxbrew/Homebrew
ARG FORCE_REBUILD
RUN cd /home/linuxbrew/.linuxbrew \ RUN cd /home/linuxbrew/.linuxbrew \
&& mkdir -p bin etc include lib opt sbin share var/homebrew/linked Cellar \ && mkdir -p bin etc include lib opt sbin share var/homebrew/linked Cellar \
&& ln -s ../Homebrew/bin/brew /home/linuxbrew/.linuxbrew/bin/ \ && ln -s ../Homebrew/bin/brew /home/linuxbrew/.linuxbrew/bin/ \

View File

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