-
Notifications
You must be signed in to change notification settings - Fork 76
81 lines (71 loc) · 2.12 KB
/
Copy pathbuild-test-image.yml
File metadata and controls
81 lines (71 loc) · 2.12 KB
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
name: build-test-image
on:
push:
branches: [main]
paths:
- 'tests/environment.*.yml'
- 'docker/Dockerfile.nmisp-test'
- '.github/workflows/build-test-image.yml'
workflow_dispatch:
workflow_call:
jobs:
build:
name: build ${{ matrix.variant }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
variant: ['2023.09', 'nightly']
fail-fast: false
steps:
- uses: actions/checkout@v7
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v7
with:
context: .
file: docker/Dockerfile.nmisp-test
build-args: |
ENV_VARIANT=${{ matrix.variant }}
platforms: linux/amd64
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/nmisp-test:latest-${{ matrix.variant }}
cache-from: type=gha
cache-to: type=gha,mode=max
verify:
name: verify ${{ matrix.variant }}
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
strategy:
matrix:
variant: ['2023.09', 'nightly']
fail-fast: false
container:
image: ghcr.io/${{ github.repository_owner }}/nmisp-test:latest-${{ matrix.variant }}
steps:
- uses: actions/checkout@v7
- name: verify core libs
run: |
python --version
python -c "import numpy, scipy, matplotlib, sympy, pytest, nbformat; print('core libs ok')"
- name: verify ML stack
run: |
python -c "import tensorflow as tf; import torch; print(f'tf={tf.__version__}, torch={torch.__version__}')"
- name: collect-only pytest (smoke)
run: |
python -m pytest --collect-only ./tests/ 2>&1 | tail -8 || true
- name: image size report
run: |
du -sh /opt/conda/envs/test-environment
df -h / | tail -2