-
Notifications
You must be signed in to change notification settings - Fork 94
84 lines (71 loc) · 2.27 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# 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]
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@v4
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
- name: Free up disk space
run: |
df -h
docker image ls
sudo apt clean
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc
df -h
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Build base-image
uses: docker/build-push-action@v5
with:
context: base-image
platforms: linux/amd64,linux/arm64
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@v5
with:
context: ${{ matrix.IMAGE }}
platforms: linux/amd64,linux/arm64
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: List Conda Packages
run: |
docker run localhost:5000/${DOCKER_ORG}/${{ matrix.IMAGE }}:PR conda list --export
- name: Report Image Size
run: |
docker image ls
- 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 }}