|
| 1 | +name: Pull Request Tests |
| 2 | +on: pull_request |
| 3 | + |
| 4 | +jobs: |
| 5 | + diff-check: |
| 6 | + runs-on: ubuntu-18.04 |
| 7 | + outputs: |
| 8 | + base: ${{ steps.base-check.outputs.output }} |
| 9 | + deepsparse: ${{ steps.deepsparse-check.outputs.output }} |
| 10 | + keras: ${{ steps.keras-check.outputs.output }} |
| 11 | + onnx: ${{ steps.onnx-check.outputs.output }} |
| 12 | + pytorch: ${{ steps.pytorch-check.outputs.output }} |
| 13 | + tensorflow_v1: ${{ steps.tensorflow_v1-check.outputs.output }} |
| 14 | + steps: |
| 15 | + - uses: actions/checkout@v2 |
| 16 | + with: |
| 17 | + fetch-depth: 0 |
| 18 | + - name: "Checking if sparseml was changed" |
| 19 | + id: base-check |
| 20 | + run: > |
| 21 | + (git diff --name-only origin/main HEAD | grep -E "[src|tests]/sparseml|setup.py") |
| 22 | + && echo "::set-output name=output::1" || echo "::set-output name=output::0" |
| 23 | + - name: "Checking if sparseml.deepsaprse was changed" |
| 24 | + id: deepsparse-check |
| 25 | + run: > |
| 26 | + (git diff --name-only origin/main HEAD | grep -E "[src|tests]/sparseml/deepsparse|setup.py") |
| 27 | + && echo "::set-output name=output::1" || echo "::set-output name=output::0" |
| 28 | + - name: "Checking if sparseml.keras was changed" |
| 29 | + id: keras-check |
| 30 | + run: > |
| 31 | + (git diff --name-only origin/main HEAD | grep -E "[src|tests]/sparseml/keras|setup.py") |
| 32 | + && echo "::set-output name=output::1" || echo "::set-output name=output::0" |
| 33 | + - name: "Checking if sparseml.onnx was changed" |
| 34 | + id: onnx-check |
| 35 | + run: > |
| 36 | + (git diff --name-only origin/main HEAD | grep -E "[src|tests]/sparseml/onnx|setup.py") |
| 37 | + && echo "::set-output name=output::1" || echo "::set-output name=output::0" |
| 38 | + - name: "Checking if sparseml.pytorch was changed" |
| 39 | + id: pytorch-check |
| 40 | + run: > |
| 41 | + (git diff --name-only origin/main HEAD | grep -E "[src|tests]/sparseml/pytorch|setup.py") |
| 42 | + && echo "::set-output name=output::1" || echo "::set-output name=output::0" |
| 43 | + - name: "Checking if sparseml.tensorflow_v1 was changed" |
| 44 | + id: tensorflow_v1-check |
| 45 | + run: > |
| 46 | + (git diff --name-only origin/main HEAD | grep -E "[src|tests]/sparseml/tensorflow_v1|setup.py") |
| 47 | + && echo "::set-output name=output::1" || echo "::set-output name=output::0" |
| 48 | + base-tests: |
| 49 | + runs-on: ubuntu-18.04 |
| 50 | + needs: diff-check |
| 51 | + if: ${{needs.diff-check.outputs.base == 1}} |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v2 |
| 54 | + - uses: actions/checkout@v2 |
| 55 | + with: |
| 56 | + repository: "neuralmagic/sparsezoo" |
| 57 | + path: "sparsezoo" |
| 58 | + - name: "⚙️ Install sparsezoo dependencies" |
| 59 | + run: pip3 install -U pip && pip3 install setuptools sparsezoo/ |
| 60 | + - name: "Clean sparsezoo directory" |
| 61 | + run: rm -r sparsezoo/ |
| 62 | + - name: "⚙️ Install dependencies" |
| 63 | + run: pip3 install .[dev] |
| 64 | + - name: "🔬 Running base tests" |
| 65 | + run: make test |
| 66 | + deepsparse-tests: |
| 67 | + runs-on: ubuntu-18.04 |
| 68 | + needs: diff-check |
| 69 | + if: ${{needs.diff-check.outputs.deepsparse == 1}} |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@v2 |
| 72 | + - uses: actions/checkout@v2 |
| 73 | + with: |
| 74 | + repository: "neuralmagic/sparsezoo" |
| 75 | + path: "sparsezoo" |
| 76 | + - name: "⚙️ Install sparsezoo dependencies" |
| 77 | + run: pip3 install -U pip && pip3 install setuptools sparsezoo/ |
| 78 | + - name: "Clean sparsezoo directory" |
| 79 | + run: rm -r sparsezoo/ |
| 80 | + - name: "⚙️ Install dependencies" |
| 81 | + run: pip3 install .[dev,deepsparse] |
| 82 | + - name: "🔬 Running deepsparse tests" |
| 83 | + run: make test TARGETS=deepsparse |
| 84 | + keras-tests: |
| 85 | + runs-on: ubuntu-18.04 |
| 86 | + needs: diff-check |
| 87 | + if: ${{needs.diff-check.outputs.keras == 1}} |
| 88 | + steps: |
| 89 | + - uses: actions/checkout@v2 |
| 90 | + - uses: actions/checkout@v2 |
| 91 | + with: |
| 92 | + repository: "neuralmagic/sparsezoo" |
| 93 | + path: "sparsezoo" |
| 94 | + - name: "⚙️ Install sparsezoo dependencies" |
| 95 | + run: pip3 install -U pip && pip3 install setuptools sparsezoo/ |
| 96 | + - name: "Clean sparsezoo directory" |
| 97 | + run: rm -r sparsezoo/ |
| 98 | + - name: "⚙️ Install dependencies" |
| 99 | + run: pip3 install .[dev,tf_keras] |
| 100 | + - name: "🔬 Running keras tests" |
| 101 | + run: make test TARGETS=keras |
| 102 | + onnx-tests: |
| 103 | + runs-on: ubuntu-18.04 |
| 104 | + needs: diff-check |
| 105 | + if: ${{needs.diff-check.outputs.onnx == 1}} |
| 106 | + steps: |
| 107 | + - uses: actions/checkout@v2 |
| 108 | + - uses: actions/checkout@v2 |
| 109 | + with: |
| 110 | + repository: "neuralmagic/sparsezoo" |
| 111 | + path: "sparsezoo" |
| 112 | + - name: "⚙️ Install sparsezoo dependencies" |
| 113 | + run: pip3 install -U pip && pip3 install setuptools sparsezoo/ |
| 114 | + - name: "Clean sparsezoo directory" |
| 115 | + run: rm -r sparsezoo/ |
| 116 | + - name: "⚙️ Install dependencies" |
| 117 | + run: pip3 install .[dev,torchvision] |
| 118 | + - name: "🔬 Running onnx tests" |
| 119 | + run: make test TARGETS=onnx |
| 120 | + pytorch-tests: |
| 121 | + runs-on: ubuntu-18.04 |
| 122 | + needs: diff-check |
| 123 | + if: ${{needs.diff-check.outputs.pytorch == 1}} |
| 124 | + steps: |
| 125 | + - uses: actions/checkout@v2 |
| 126 | + - uses: actions/checkout@v2 |
| 127 | + with: |
| 128 | + repository: "neuralmagic/sparsezoo" |
| 129 | + path: "sparsezoo" |
| 130 | + - name: "⚙️ Install sparsezoo dependencies" |
| 131 | + run: pip3 install -U pip && pip3 install setuptools sparsezoo/ |
| 132 | + - name: "Clean sparsezoo directory" |
| 133 | + run: rm -r sparsezoo/ |
| 134 | + - name: "⚙️ Install dependencies" |
| 135 | + run: pip3 install .[dev,torchvision] |
| 136 | + - name: "🔬 Running pytorch tests" |
| 137 | + run: make test TARGETS=pytorch |
| 138 | + tensorflow-v1-tests: |
| 139 | + runs-on: ubuntu-18.04 |
| 140 | + needs: diff-check |
| 141 | + if: ${{needs.diff-check.outputs.tensorflow_v1 == 1}} |
| 142 | + steps: |
| 143 | + - uses: actions/checkout@v2 |
| 144 | + - uses: actions/checkout@v2 |
| 145 | + with: |
| 146 | + repository: "neuralmagic/sparsezoo" |
| 147 | + path: "sparsezoo" |
| 148 | + - name: "⚙️ Install sparsezoo dependencies" |
| 149 | + run: pip3 install -U pip && pip3 install setuptools sparsezoo/ |
| 150 | + - name: "Clean sparsezoo directory" |
| 151 | + run: rm -r sparsezoo/ |
| 152 | + - name: "⚙️ Install dependencies" |
| 153 | + run: pip3 install .[dev,tf_v1] |
| 154 | + - name: "🔬 Running tensorflow_v1 tests" |
| 155 | + run: make test TARGETS=tensorflow_v1 |
0 commit comments