@@ -43,10 +43,12 @@ jobs:
4343 steps :
4444 - name : Checkout Repo
4545 uses : actions/checkout@v4
46+
4647 - name : Setup Python
4748 uses : actions/setup-python@v5
4849 with :
4950 python-version : ${{ matrix.python }}
51+
5052 - name : Install Dependencies
5153 run : |
5254 sudo apt-get update
6062 pip install torchvision==${{ matrix.torchvision }} --index-url https://download.pytorch.org/whl/cpu
6163 pip install torchaudio==${{ matrix.torchaudio }} --index-url https://download.pytorch.org/whl/cpu
6264 pip list
65+
66+ - name : Cache CIFAR-10 dataset
67+ uses : actions/cache@v3
68+ with :
69+ path : ~/.art/data/cifar-10-batches-py
70+ key : cifar10-dataset-cache-v1
71+
72+ - name : Cache MNIST dataset
73+ uses : actions/cache@v3
74+ with :
75+ path : ~/.art/data/mnist.npz
76+ key : mnist-dataset-cache-v1
77+
78+ - name : Download and extract CIFAR-10 if not cached
79+ run : |
80+ mkdir -p ~/.art/data
81+ if [ ! -d ~/.art/data/cifar-10-batches-py ]; then
82+ echo "Downloading CIFAR-10 dataset..."
83+ if curl -L -f -o cifar-10-python.tar.gz https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz; then
84+ echo "Downloaded from www.cs.toronto.edu"
85+ else
86+ echo "Primary download failed, trying Dropbox mirror..."
87+ curl -L -o cifar-10-python.tar.gz "https://www.dropbox.com/scl/fi/6mhiq4rtfszqrosasp8a9/cifar-10-batches-py.tar.gz?rlkey=g6v114un4je233j52tu5tdsbe&st=gxo2e50q&dl=1"
88+ fi
89+ tar -xzf cifar-10-python.tar.gz -C ~/.art/data/
90+ else
91+ echo "CIFAR-10 already cached."
92+ fi
93+
94+ - name : Download MNIST if not cached
95+ run : |
96+ mkdir -p ~/.art/data
97+ if [ ! -f ~/.art/data/mnist.npz ]; then
98+ echo "Downloading MNIST dataset..."
99+ curl -L -o ~/.art/data/mnist.npz https://s3.amazonaws.com/img-datasets/mnist.npz
100+ else
101+ echo "MNIST already cached."
102+ fi
103+
63104 - name : Run ${{ matrix.name }} ${{ matrix.module }} Tests
64105 run : ./run_tests.sh ${{ matrix.framework }} ${{ matrix.module }}
106+
65107 - name : Upload coverage to Codecov
66108 uses : codecov/codecov-action@v5
67109 with :
0 commit comments