From 40ab58c5d83309c518f79b53663e65e1e167cb22 Mon Sep 17 00:00:00 2001 From: Jakub Kaczmarzyk Date: Thu, 7 Mar 2024 13:40:11 -0500 Subject: [PATCH] combine linux/macos/windows tests into one file (#3) --- .github/workflows/cli-test-linux.yml | 41 --------- .github/workflows/cli-test-macos.yml | 41 --------- .github/workflows/cli-test-windows.yml | 44 --------- .github/workflows/cli-test.yml | 120 +++++++++++++++++++++++++ 4 files changed, 120 insertions(+), 126 deletions(-) delete mode 100644 .github/workflows/cli-test-linux.yml delete mode 100644 .github/workflows/cli-test-macos.yml delete mode 100644 .github/workflows/cli-test-windows.yml create mode 100644 .github/workflows/cli-test.yml diff --git a/.github/workflows/cli-test-linux.yml b/.github/workflows/cli-test-linux.yml deleted file mode 100644 index 4d42813..0000000 --- a/.github/workflows/cli-test-linux.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Linux -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] -jobs: - Test-CLI: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - steps: - - name: Cache sample WSI - uses: actions/cache@v3 - with: - path: ~/wsi/ - key: sample-wsi - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install WSInfer-CLI - run: | - python -m pip install --upgrade pip setuptools wheel - python -m pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu - python -m pip install . - - name: Download sample WSI - run: | - mkdir -p ~/wsi - cd ~/wsi - wget -nc -q https://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/CMU-1.svs - cd - - - name: Run tests - # Go to a different directory to test that WSInfer-MIL still finds everything it needs. - # Test it twice so the second time we get cache hits. - run: | - cd /tmp - wsinfer-mil run -m kaczmarj/pancancer-tissue-classifier.tcga -i ~/wsi/CMU-1.svs - wsinfer-mil run -m kaczmarj/pancancer-tissue-classifier.tcga -i ~/wsi/CMU-1.svs diff --git a/.github/workflows/cli-test-macos.yml b/.github/workflows/cli-test-macos.yml deleted file mode 100644 index 968e5ca..0000000 --- a/.github/workflows/cli-test-macos.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: macOS -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] -jobs: - Test-CLI: - runs-on: macos-latest - strategy: - matrix: - python-version: ["3.10"] - steps: - - name: Cache sample WSI - uses: actions/cache@v3 - with: - path: ~/wsi/ - key: sample-wsi - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install WSInfer-CLI - run: | - python -m pip install --upgrade pip setuptools wheel - python -m pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu - python -m pip install . - - name: Download sample WSI - run: | - mkdir -p ~/wsi - cd ~/wsi - wget -nc -q https://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/CMU-1.svs - cd - - - name: Run tests - # Go to a different directory to test that WSInfer-MIL still finds everything it needs. - # Test it twice so the second time we get cache hits. - run: | - cd /tmp - wsinfer-mil run -m kaczmarj/pancancer-tissue-classifier.tcga -i ~/wsi/CMU-1.svs - wsinfer-mil run -m kaczmarj/pancancer-tissue-classifier.tcga -i ~/wsi/CMU-1.svs diff --git a/.github/workflows/cli-test-windows.yml b/.github/workflows/cli-test-windows.yml deleted file mode 100644 index 4edc3ec..0000000 --- a/.github/workflows/cli-test-windows.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Windows -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] -jobs: - Test-CLI: - runs-on: windows-latest - strategy: - matrix: - python-version: ["3.10"] - steps: - - name: Cache sample WSI - id: cache-wsi - uses: actions/cache@v3 - with: - path: ~/wsi/ - key: sample-wsi - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install WSInfer-CLI - run: | - python -m pip install --upgrade pip setuptools wheel - python -m pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu - python -m pip install . - - name: Download sample WSI - if: steps.cache-wsi.outputs.cache-hit != 'true' - run: | - mkdir -p ~/wsi - cd ~/wsi - Invoke-WebRequest -URI https://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/CMU-1.svs -OutFile CMU-1.svs - cd - - - name: Run tests - # Go to a different directory to test that WSInfer-MIL still finds everything it needs. - # Test it twice so the second time we get cache hits. - run: | - mkdir -p ~/foobar - cd ~/foobar - wsinfer-mil run -m kaczmarj/pancancer-tissue-classifier.tcga -i ~/wsi/CMU-1.svs - wsinfer-mil run -m kaczmarj/pancancer-tissue-classifier.tcga -i ~/wsi/CMU-1.svs diff --git a/.github/workflows/cli-test.yml b/.github/workflows/cli-test.yml new file mode 100644 index 0000000..3240e04 --- /dev/null +++ b/.github/workflows/cli-test.yml @@ -0,0 +1,120 @@ +name: Test CLI +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + + Linux: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + steps: + - name: Cache sample WSI + id: cache-wsi + uses: actions/cache@v3 + with: + path: ~/wsi/ + key: sample-wsi + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install WSInfer-CLI + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu + python -m pip install . + - name: Download sample WSI + if: steps.cache-wsi.outputs.cache-hit != 'true' + run: | + mkdir -p ~/wsi + cd ~/wsi + wget -nc -q https://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/CMU-1.svs + cd - + - name: Run tests + # Go to a different directory to test that WSInfer-MIL still finds everything it needs. + # Test it twice so the second time we get cache hits. + run: | + cd /tmp + wsinfer-mil run -m kaczmarj/pancancer-tissue-classifier.tcga -i ~/wsi/CMU-1.svs + wsinfer-mil run -m kaczmarj/pancancer-tissue-classifier.tcga -i ~/wsi/CMU-1.svs + + macOS: + runs-on: macos-latest + strategy: + matrix: + python-version: ["3.10"] + steps: + - name: Cache sample WSI + id: cache-wsi + uses: actions/cache@v3 + with: + path: ~/wsi/ + key: sample-wsi + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install WSInfer-CLI + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu + python -m pip install . + - name: Download sample WSI + if: steps.cache-wsi.outputs.cache-hit != 'true' + run: | + mkdir -p ~/wsi + cd ~/wsi + wget -nc -q https://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/CMU-1.svs + cd - + - name: Run tests + # Go to a different directory to test that WSInfer-MIL still finds everything it needs. + # Test it twice so the second time we get cache hits. + run: | + cd /tmp + wsinfer-mil run -m kaczmarj/pancancer-tissue-classifier.tcga -i ~/wsi/CMU-1.svs + wsinfer-mil run -m kaczmarj/pancancer-tissue-classifier.tcga -i ~/wsi/CMU-1.svs + + Windows: + runs-on: windows-latest + strategy: + matrix: + python-version: ["3.10"] + steps: + - name: Cache sample WSI + id: cache-wsi + uses: actions/cache@v3 + with: + path: ~/wsi/ + key: sample-wsi + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install WSInfer-CLI + run: | + python -m pip install --upgrade pip setuptools wheel + python -m pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cpu + python -m pip install . + - name: Download sample WSI + if: steps.cache-wsi.outputs.cache-hit != 'true' + run: | + mkdir -p ~/wsi + cd ~/wsi + Invoke-WebRequest -URI https://openslide.cs.cmu.edu/download/openslide-testdata/Aperio/CMU-1.svs -OutFile CMU-1.svs + cd - + - name: Run tests + # Go to a different directory to test that WSInfer-MIL still finds everything it needs. + # Test it twice so the second time we get cache hits. + run: | + mkdir -p ~/foobar + cd ~/foobar + wsinfer-mil run -m kaczmarj/pancancer-tissue-classifier.tcga -i ~/wsi/CMU-1.svs + wsinfer-mil run -m kaczmarj/pancancer-tissue-classifier.tcga -i ~/wsi/CMU-1.svs