Git Product home page Git Product logo

cygwin-install-action's Introduction

Cygwin Install GitHub Action

This GitHub Action can be used in a workflow to install Cygwin.

e.g.

- run: git config --global core.autocrlf input

- uses: actions/checkout@v2

- uses: cygwin/cygwin-install-action@master

- run: bash tests/script.sh  # see footnote [1]

Please fix my terrible cargo-cult PowerShell.

Parameters

Input Default Description
platform x86_64 Install the x86 or x86_64 version of Cygwin.
packages none List of additional packages to install.
install-dir C:\cygwin Installation directory
site http://mirrors.kernel.org/sourceware/cygwin/ Mirror sites to install from, separated by whitespace
pubkeys none Absolute paths of extra public key files (RFC4880 format), separated by whitespace
check-sig true Whether to check the setup.ini signature
add-to-path true Whether to add Cygwin's /bin directory to the system PATH

Line endings

If you're going to use actions/checkout in your workflow, you should precede that with

- run: git config --global core.autocrlf input

to ensure that any shell scripts etc. in your repository don't get checked out with \r\n line endings (leading to '\r': command not found errors).

Likewise, if you have multiple lines of shell script in a YAML block for run: in your workflow file, the file this is written into on the runner ends up with \r\n line endings.

You can use >- (rather than |) to ensure that it doesn't contain any newlines.

Alternatively, you can also use:

  • igncr in the SHELLOPTS environment variable
  • invoke bash with -o igncr

PATH

By default, this action prepends Cygwin's /usr/bin directory to the PATH.

However, if you want to ensure that PATH only contains Cygwin executables, and other stuff installed in the VM image isn't going to get picked up:

  • Set PATH to something like /usr/bin:$(cygpath ${SYSTEMROOT})/system32 in your shell script

or,

  • Put CYGWIN_NOWINPATH=1 into the environment
  • start a login shell with bash --login
  • because the profile script from does cd ${HOME}, either:
    • cd ${GITHUB_WORKSPACE} in your shell script, or
    • prevent the profile script from changing directory by putting CHERE_INVOKING into the environment

If you want the opposite โ€“ the system PATH to remain unchanged by this action โ€“ add add-to-path: false to the action settings.

Symlinks

Cygwin's setup creates Cygwin-style symlinks by default, and some executables (e.g. python) are symlinks.

Since CMD and PowerShell don't understand those symlinks, you cannot run those executables directly in a run: in your workflow. Execute them via bash or env instead.

Alternatively, putting e.g. CYGWIN=winsymlinks:native into the workflow's environment works, since setup now honours that.

Mirrors and signatures

You probably don't need to change the setting for site, and you shouldn't change check-sig unless you're very confident it's appropriate and necessary. These options are very unlikely to be useful except in some very isolated circumstances, such as using the Cygwin Time Machine.

[1] The Workflow documentation suggests you should also use bash options -eo pipefail, omitted here for clarity

cygwin-install-action's People

Contributors

me-and avatar jon-turney avatar kgraefe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.