-
Notifications
You must be signed in to change notification settings - Fork 49
48 lines (42 loc) · 1.5 KB
/
dockerfile_dev.yml
File metadata and controls
48 lines (42 loc) · 1.5 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
name: docker setup (dev )
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Build CEASIOMpy installation image
run: docker build -t ceasiompy-install-test -f docker/Dockerfile.dev .
- name: Maximize Build Space & Swap
run: |
# Create a 4GB swap file to assist the 7GB RAM
SWAPFILE=/swapfile_ceasiompy
if sudo swapon --show=NAME --noheadings | grep -qx "$SWAPFILE"; then
echo "Swap already active at $SWAPFILE"
else
sudo swapoff "$SWAPFILE" 2>/dev/null || true
sudo rm -f "$SWAPFILE"
sudo fallocate -l 4G "$SWAPFILE" || sudo dd if=/dev/zero of="$SWAPFILE" bs=1M count=4096
sudo chmod 600 "$SWAPFILE"
sudo mkswap "$SWAPFILE"
sudo swapon "$SWAPFILE"
fi
free -h
sudo swapon --show
- name: Run container smoke test
run: |
docker run --rm \
-e DISPLAY=:99 \
-e LIBGL_ALWAYS_SOFTWARE=1 \
-e OMPI_ALLOW_RUN_AS_ROOT=1 \
-e OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1 \
ceasiompy-install-test \
/bin/bash -lc "source /opt/conda/etc/profile.d/conda.sh && python -c \"print('Installed CEASIOMpy Successfully !')\""
- name: Remove Docker image
if: always()
run: docker rmi ceasiompy-install-test || true