From 4d419645319c661cb2e93fb66a39e29ddecc808c Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 4 Jul 2023 14:18:38 -0700 Subject: [PATCH] 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. --- .github/workflows/python-tests.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index d96cc129f..02c75d100 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -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: |