forked from pangeo-data/pangeo-docker-images
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (57 loc) · 1.84 KB
/
Test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Any PR opened, build images and run tests
name: Test
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
pull_request:
types: [opened, synchronize, reopened]
env:
DOCKER_ORG: pangeo
GITHUB_SHA: ${{ github.sha }}
GITHUB_REF: ${{ github.ref }}
jobs:
matrix-build:
strategy:
fail-fast: false
matrix:
IMAGE: [base-notebook, pangeo-notebook, ml-notebook, pytorch-notebook, forge]
name: ${{ matrix.IMAGE }}
runs-on: ubuntu-latest
services:
# https://github.com/docker/build-push-action/blob/master/docs/advanced/local-registry.md#local-registry
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
- name: Build base-image
uses: docker/build-push-action@v3
with:
context: base-image
tags: localhost:5000/pangeo/base-image:PR
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build Only
uses: docker/build-push-action@v3
with:
context: ${{ matrix.IMAGE }}
push: true
tags: localhost:5000/${{env.DOCKER_ORG}}/${{ matrix.IMAGE }}:PR
build-args: PANGEO_BASE_IMAGE_TAG=PR
build-contexts: |
pangeo/base-image:PR=docker-image://localhost:5000/pangeo/base-image:PR
- name: Report Image Size and Conda Packages
run: |
docker images
docker run localhost:5000/${DOCKER_ORG}/${{ matrix.IMAGE }}:PR conda list --export
- name: Test Image
run: |
docker run -u 1000 -w /srv/test -v $PWD:/srv/test localhost:5000/${DOCKER_ORG}/${{ matrix.IMAGE }}:PR ./run_tests.sh ${{ matrix.IMAGE }}