From 2757ef1b909704046951bf411be7fd274f9ceec9 Mon Sep 17 00:00:00 2001
From: James Graham <j.graham@soton.ac.uk>
Date: Fri, 28 May 2021 22:00:15 +0100
Subject: [PATCH] ci: add Windows to CI matrix

Attempt caching of pip downloads on all OSes
---
 .github/workflows/python-package.yml | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml
index 44d8b09..58bd9fc 100644
--- a/.github/workflows/python-package.yml
+++ b/.github/workflows/python-package.yml
@@ -15,7 +15,7 @@ jobs:
       fail-fast: false
       matrix:
         python-version: ["3.6", "3.7", "3.8", "3.9"]
-        os: [ubuntu-latest, macos-latest]
+        os: [ubuntu-latest, macos-latest, windows-latest]
 
     runs-on: ${{ matrix.os }}
 
@@ -27,22 +27,29 @@ jobs:
       with:
         python-version: ${{ matrix.python-version }}
 
+    - name: Update pip
+      run: |
+        python -m pip install --upgrade pip
+
+    - name: Get pip cache dir
+      id: pip-cache
+      run: |
+        echo "::set-output name=dir::$(pip cache dir)"
+
     - name: Cache pip
       uses: actions/cache@v2
       with:
-        # This path is specific to Ubuntu
-        path: ~/.cache/pip
+        path: ${{ steps.pip-cache.outputs.dir }}
         # Look to see if there is a cache hit for the corresponding requirements file
         key: ${{ runner.os }}-pip-${{ hashFiles('pyproject.toml') }}
         restore-keys: |
           ${{ runner.os }}-pip-
           ${{ runner.os }}-    
 
-    - name: Install Dependencies
+    - name: Install dependencies
       run: |
-        python -m pip install --upgrade pip
         pip install tox
 
-    - name: Run Tests / Linter
+    - name: Run tests / linter
       run: |
         tox
-- 
GitLab