@@ -29,39 +29,81 @@ jobs:
2929 matrix :
3030 module : [attacks_1, attacks_2, estimators, defences, metrics, art]
3131 include :
32- - name : legacy (TensorFlow 2.14.0 Keras 2.14 .0 PyTorch 1.13.1 scikit-learn 1.6.1 Python 3.9 )
32+ - name : legacy (TensorFlow 2.18.1 Keras 3.10 .0 PyTorch 2.7.0 scikit-learn 1.6.1 Python 3.10 )
3333 framework : legacy
3434 python : ' 3.10'
35- tensorflow : 2.14.0
36- keras : 2.14 .0
37- torch : 1.13.1+cpu
38- torchvision : 0.14.1+cpu
39- torchaudio : 0.13.1+cpu
35+ tensorflow : 2.18.1
36+ keras : 3.10 .0
37+ torch : 2.7.0
38+ torchvision : 0.22.0
39+ torchaudio : 2.7.0
4040 scikit-learn : 1.6.1
4141
4242 name : Run ${{ matrix.module }} ${{ matrix.name }} Tests
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
5355 sudo apt-get -y -q install ffmpeg libavcodec-extra
5456 python -m pip install --upgrade pip setuptools wheel
55- pip install -q -r requirements_test.txt
57+ pip install -q -r <(sed '/^tensorflow/d;/^keras/d;/^torch/d;/^torchvision/d;/^torchaudio/d' requirements_test.txt)
5658 pip install tensorflow==${{ matrix.tensorflow }}
5759 pip install keras==${{ matrix.keras }}
5860 pip install scikit-learn==${{ matrix.scikit-learn }}
5961 pip install torch==${{ matrix.torch }} --index-url https://download.pytorch.org/whl/cpu
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