1
+ name : ML Project Test
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs :
6
+ test :
7
+ runs-on : ubuntu-latest
8
+ env :
9
+ DEBIAN_FRONTEND : noninteractive
10
+
11
+ steps :
12
+ - name : Check out repository
13
+ uses : actions/checkout@v3
14
+
15
+ - name : Install Act dependencies
16
+ if : ${{ env.ACT }}
17
+ run : |
18
+ apt-get update && apt-get install sudo -y
19
+
20
+ - name : Install ping utility
21
+ run : |
22
+ sudo apt-get update
23
+ sudo apt-get install -y iputils-ping
24
+
25
+ - name : Set timezone to UTC
26
+ run : |
27
+ export DEBIAN_FRONTEND=noninteractive
28
+ if [ -n "$ACT" ]; then
29
+ ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
30
+ echo "Etc/UTC" > /etc/timezone
31
+ apt-get update
32
+ apt-get install -y tzdata
33
+ dpkg-reconfigure -f noninteractive tzdata
34
+ else
35
+ sudo ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime
36
+ echo "Etc/UTC" | sudo tee /etc/timezone
37
+ sudo apt-get update
38
+ sudo apt-get install -y tzdata
39
+ sudo dpkg-reconfigure -f noninteractive tzdata
40
+ fi
41
+
42
+ - name : Install Python 3.10 and Git
43
+ run : |
44
+ export DEBIAN_FRONTEND=noninteractive
45
+ sudo apt-get update
46
+ sudo apt-get install -y gnupg lsb-release software-properties-common curl git
47
+
48
+ echo "deb [trusted=yes] http://ppa.launchpadcontent.net/deadsnakes/ppa/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/deadsnakes-ppa.list
49
+ sudo apt-get update
50
+ sudo apt-get install -y python3.10 python3.10-venv python3.10-distutils
51
+
52
+ # Set Python 3.10 as default
53
+ ln -sf /usr/bin/python3.10 /usr/local/bin/python
54
+ ln -sf /usr/bin/python3.10 /usr/local/bin/python3
55
+
56
+ curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
57
+ python3.10 -m ensurepip --upgrade
58
+ ln -sf /usr/local/bin/pip3.10 /usr/local/bin/pip
59
+ ln -sf /usr/local/bin/pip3.10 /usr/local/bin/pip3
60
+
61
+ python --version
62
+ pip --version
63
+
64
+ - name : Set environment variables
65
+ run : |
66
+ echo "PYTHONHTTPSVERIFY=0" >> $GITHUB_ENV
67
+ echo "CURL_CA_BUNDLE=" >> $GITHUB_ENV
68
+ echo "SSL_CERT_FILE=" >> $GITHUB_ENV
69
+ echo "GIT_SSL_NO_VERIFY=true" >> $GITHUB_ENV
70
+
71
+ - name : Setup ML project
72
+ run : |
73
+ cd $GITHUB_WORKSPACE
74
+ # Make install.sh executable if it isn't already
75
+ chmod +x install.sh
76
+ # Run the installation script
77
+ ./install.sh
78
+
79
+ - name : Debug virtual environment
80
+ run : |
81
+ VENV_PATH=$(find $GITHUB_WORKSPACE -type d -name "ml_grid_env")
82
+ echo "VENV_PATH=$VENV_PATH" >> $GITHUB_ENV
83
+ source "$VENV_PATH/bin/activate"
84
+ which python
85
+ python --version
86
+
87
+ - name : Run tests
88
+ run : |
89
+ cd $GITHUB_WORKSPACE
90
+ source "$VENV_PATH/bin/activate"
91
+ pytest notebooks/unit_test_synthetic.ipynb
0 commit comments