Skip to content

ENH - Have a CI runner with Windows #312

Open

Description

@AljenU

Windows not yet supported by matlab-actions. When it becomes available, to add it, such that at least the minimal-install tests are also run on windows.

Adaptations required

  • Put directory names in the github xml files such that they are updated for windows/linux (see a next comment)
  • Add a matrix to the test definition .yml with both ubuntu and windows (see a next comment)
  • Implement install scripts for windows, and call from trigger_install.py. Can be done gradually, for minimal-install tests very little is needed.

Activity

  1. AljenU commented on Dec 8, 2021

    @AljenU
    CollaboratorAuthor

    Put directory names in the github xml files such that they are updated for windows/linux

    • Replace all occurrences of "/home/runner" in the aap_parameters_defaults_Github files with "$HOME"
    • Add parameter_xml_env_var_replace() to trigger_install.py, and call it in the main() there before do_install()
    def parameter_xml_env_var_replace():
        """Platform-indepent replacement of environment variables in the source parameter xml
    
        Path specifications in the parameter xml use environment variable references because
        paths are different on the different runner platforms. However, environment variable
        references themselves are also platform-dependent.
    
        Replace specific unix-style environment variable references in the parameter xml file
        with the value of the environment variable on the current runner platform, to produce
        a parameter xml file without env var references."""
    
        var_workspace = os.environ['GITHUB_WORKSPACE']
        var_par_xml = os.environ['PARAMETER_XML']
        # TODO: check that home is also ok on windows.
        var_home = os.environ['HOME']
    
        # Read in the file
        fname = os.path.join(var_workspace, '.github', 'workflows', var_par_xml)
        with open(fname, 'r') as file :
            filedata = file.read()
    
        # Replace $HOME with its value
        filedata = filedata.replace('$HOME', var_home)
    
        # Write the file out again
        with open(fname, 'w') as file:
            file.write(filedata)
    
  2. AljenU commented on Dec 8, 2021

    @AljenU
    CollaboratorAuthor

    Add a matrix to the test definition .yml with both ubuntu and windows

    Also a few other parts needed updating. At least, replace

        runs-on: ubuntu-latest
    
    XXX
    
          - name: Maximize build space
    
    XXX
    
          - name: Archive results
            uses: actions/upload-artifact@v2
            with:
              name: testlog_${{github.job}}
    
    

    With

        runs-on: ${{ matrix.os }}
        strategy:
          matrix:
            # Multi-platform job version
            os: [ubuntu-latest, windows-latest]
    
    XXX
    
          - name: Maximize build space
            if: matrix.os == 'ubuntu-latest'
    
    XXX
    
          - name: Archive results
            uses: actions/upload-artifact@v2
            with:
              name: testlog_${{ matrix.os }}_${{github.job}}
    
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions