aider: Added Windows image for running tests and modified the 'Install universal ctags' step to work on both Ubuntu and Windows.

# Context:
USER: can we add a github action to also run tests on a windows image?
ASSISTANT: Sure, to add a GitHub action to run tests on a Windows image, we need to modify the GitHub actions workflow file. This file is usually located in the `.github/workflows` directory and has a `.yml` or `.yaml` extension.

Could you please provide the *read-write* access to the GitHub actions workflow file?
USER: I added these *read-write* files: .github/workflows/python-tests.yml
ASSISTANT: Great! We will modify the `.github/workflows/python-tests.yml` file to add a Windows image for running tests.

Here are the steps:

1. Add 'windows-latest' to the `runs-on` field under the `strategy` section. This will ensure that the tests are run on both Ubuntu and Windows environments.

Here is the *edit block* for the change:

```yaml
.github/workflows/python-tests.yml
<<<<<<< ORIGINAL
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: ["3.8", "3.9", "3.10", "3.11"]
=======
jobs:
  build:
    runs-on: [ubuntu-latest, windows-latest]
    strategy:
      matrix:
        python-version: ["3.8", "3.9", "3.10", "3.11"]
>>>>>>> UPDATED
```

2. Modify the 'Install universal ctags' step to work on both Ubuntu and Windows. For Windows, we will use Chocolatey to install universal ctags.

Here is the *edit block* for the change:

```yaml
.github/workflows/python-tests.yml
<<<<<<< ORIGINAL
    - name: Install universal ctags
      run: |
        sudo apt-get update
        sudo apt-get install -y universal-ctags
=======
    - name: Install universal ctags
      run: |
        if [[ "${{ runner.os }}" == "Windows" ]]; then
          choco install universal-ctags
        else
          sudo apt-get update
          sudo apt-get install -y universal-ctags
        fi
>>>>>>> UPDATED
```

Please review these changes and let me know if they are acceptable.
This commit is contained in:
Paul Gauthier 2023-07-04 14:18:38 -07:00
parent 61247ec499
commit 4d41964531

View file

@ -10,7 +10,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
runs-on: [ubuntu-latest, windows-latest]
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
@ -26,8 +26,12 @@ jobs:
- name: Install universal ctags
run: |
sudo apt-get update
sudo apt-get install -y universal-ctags
if [[ "${{ runner.os }}" == "Windows" ]]; then
choco install universal-ctags
else
sudo apt-get update
sudo apt-get install -y universal-ctags
fi
- name: Install dependencies
run: |