Skip to content

Commit

Permalink
Try using cache for build
Browse files Browse the repository at this point in the history
Typos fixed
  • Loading branch information
simar0at committed Sep 28, 2023
1 parent 40fa32f commit 01665a5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/Build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,41 @@ jobs:
STACK_VERSION: ${{ matrix.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
# CNB are not multi-arch ready as of May 2022 so this is not needed
# It causes problems with this workflow so test later
# - name: Set up QEMU
# uses: docker/setup-qemu-action@v1
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Cache var-cache-apt
uses: actions/cache@v3
with:
path: var-cache-apt
key: var-cache-apt-${{ hashFiles('Dockerfile') }}
- name: Cache var-lib-apt
uses: actions/cache@v3
with:
path: var-lib-apt
key: var-lib-apt-${{ hashFiles('Dockerfile') }}
- name: inject var-cache-apt into docker
uses: reproducible-containers/buildkit-cache-dance@v2.1.2
with:
cache-source: var-cache-apt
cache-target: /var/cache/apt
- name: inject var-lib-apt into docker
uses: reproducible-containers/buildkit-cache-dance@v2.1.2
with:
cache-source: var-lib-apt
cache-target: /var/lib/apt
- name: Build and push for stack ${{ env.STACK_VERSION }}
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
build-args: |
Expand Down
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ LABEL "maintainer" "Omar Siam <omar.siam@oeaw.ac.at>"

# Cypress dependencies

RUN apt-get update && \
ENV DEBIAN_FRONTEND=noninteractive
RUN \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
rm -f /etc/apt/apt.conf.d/docker-clean && \
echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' >/etc/apt/apt.conf.d/keep-cache && \
apt-get update && \
apt-get install -y --no-install-recommends libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb curl && \
apt-get clean
ENV CYPRESS_CACHE_FOLDER /tmp/cache/cypress
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
A container for gitlab CI/CD test stage with cypress.io dependencies
======================================================================

The default herokuish container lacks the X11 and other dependencies the headless electron browser of cypress.io e2e testing needd. This repo contains an add on Dockerfile that adds these dependencies as well as some example config files that are needed to make this work
The default herokuish container lacks the X11 and other dependencies the headless electron browser of cypress.io e2e testing needs. This repo contains an add on Dockerfile that adds these dependencies as well as some example config files that are needed to make this work

Better e2e tests than none at all!

Expand All @@ -15,7 +15,7 @@ Best practice: Add version information for node and npm to your package JSON. E.
```json
,
"engines": {
"node": "12.x",
"node": "20.x",
"npm": "6.14.x"
}
```
Expand Down

0 comments on commit 01665a5

Please sign in to comment.