Repository navigation
39 lines (35 loc) · 1.49 KB
/
Copy pathdocker.yml
File metadata and controls
39 lines (35 loc) · 1.49 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
# Builds the Dockerfile and runs the reproducibility tests inside the image, so
# the container is checked, not only described. Runs when the image's inputs change.
name: Docker image
on:
push:
branches: [ master ]
paths: [ "Dockerfile", "pyproject.toml", "poetry.lock", ".github/workflows/docker.yml" ]
pull_request:
branches: [ master ]
paths: [ "Dockerfile", "pyproject.toml", "poetry.lock", ".github/workflows/docker.yml" ]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# The image is about 7 GB (torch bundles its CUDA libraries); make room.
- name: Free runner disk space
run: sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL
- name: Build image
run: docker build -t bindsnet .
# Runners have no GPU, and the image's CUDA torch build can segfault there while
# preloading CUDA (see .github/scripts/use_cpu_torch.sh), so the test container
# swaps in the CPU build of the same version; everything else is the image as built.
- name: Run reproducibility tests in the image
run: >-
docker run --rm bindsnet bash -c
".github/scripts/use_cpu_torch.sh python && python -m pytest -q test/repro"