Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the install directory configurable #3

Merged
merged 3 commits into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,36 @@ jobs:
echo
env:
COMBINATION: 1

install-dir-test:
runs-on: windows-latest
name: 'Check install directory behaviour'

strategy:
matrix:
include:
- install-dir: C:\tools\cygwin
- install-dir: D:\cygwin64

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

- uses: actions/checkout@v2

- name: Install Cygwin
uses: ./
with:
install-dir: "${{ matrix.install-dir }}"

- name: Check working directory
run: |
if [[ "$(cygpath -aw /)" == '${{ matrix.install-dir }}' ]]; then
echo "Installed in $(cygpath -aw /)"
else
exit 1
fi
# Only specify the shell by name; GitHub actions should find the correct
# executable thanks to the action setting the path appropriately.
jon-turney marked this conversation as resolved.
Show resolved Hide resolved
shell: bash
env:
SHELLOPTS: igncr
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ 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.
| 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

Line endings
------------
Expand Down
14 changes: 9 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ inputs:
packages:
description: Packages to install
required: false
install-dir:
# by default, install to C:\cygwin rather than the platform dependent
# default to make everything simpler
description: Installation directory
required: false
default: C:\cygwin

runs:
using: "composite"
Expand All @@ -35,9 +41,7 @@ runs:
'-qgnO',
'-s', 'http://mirrors.kernel.org/sourceware/cygwin/',
'-l', 'C:\cygwin-packages',
# always install to C:\cygwin rather than the platform dependent
# default to make everything simpler
'-R', 'C:\cygwin'
'-R', '${{ inputs.install-dir }}'
)

if ($pkg_list.Count -gt 0) {
Expand All @@ -51,9 +55,9 @@ runs:
shell: powershell

- run: |
echo "C:\cygwin\bin" >> $env:GITHUB_PATH
echo "${{ inputs.install-dir }}\bin" >> $env:GITHUB_PATH
# run login shell to copy skeleton profile files
C:\cygwin\bin\bash.exe --login
${{ inputs.install-dir }}\bin\bash.exe --login
shell: powershell

branding:
Expand Down