Skip to content

Commit

Permalink
Update CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
csadorf committed Aug 16, 2022
1 parent 7d450e9 commit 7154912
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
39 changes: 23 additions & 16 deletions .github/workflows/build_and_test_on_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# 4. Copy id_rsa file from the docker container to local folder.
# 5. Restart the container and check that the id_rsa file didn't change.

name: build-and-test-image-from-pull-request
name: build-and-test

on: [pull_request]

Expand All @@ -17,29 +17,36 @@ jobs:
build-and-test:

runs-on: ubuntu-latest
timeout-minutes: 45
timeout-minutes: 15

services:
registry:
image: registry:2
ports:
- 5000:5000

steps:
- uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
- name: Build aiida image
uses: docker/build-push-action@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build image locally
uses: docker/build-push-action@v2
context: stack/aiida
tags: localhost:5000/aiidalab/aiida:latest
push: true
- name: Build aiidalab image
uses: docker/build-push-action@v3
with:
context: stack/aiidalab
tags: aiidalab/aiidalab:latest
load: true
push: false
tags: aiidalab-docker-stack:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
BASE_IMAGE=localhost:5000/aiidalab/aiida:latest
- uses: actions/setup-python@v4
with:
python-version: '3.10'
Expand Down
3 changes: 2 additions & 1 deletion stack/aiidalab/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# TODO: use proper base tag
FROM aiidalab/aiida:latest
ARG BASE_IMAGE=aiidalab/aiida:latest
FROM ${BASE_IMAGE}

LABEL maintainer="AiiDAlab Team <aiidalab@materialscloud.org>"

Expand Down

0 comments on commit 7154912

Please sign in to comment.