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

experimental support for custom shell (multi-line run steps) #21

Closed
wants to merge 12 commits into from
Closed
130 changes: 102 additions & 28 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: install deps
run: npm ci
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- name: run action
uses: ./
- name: test MSYS
Expand All @@ -31,8 +35,12 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: install deps
run: npm ci
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- name: run action
uses: ./
- name: test MSYS
Expand All @@ -55,8 +63,12 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: install deps
run: npm ci
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- name: run action
uses: ./
- name: test MSYS
Expand All @@ -72,15 +84,36 @@ jobs:
env:
MSYSTEM: MINGW32

shell:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- name: run action
uses: ./
- shell: msys2 {0}
run: |
uname -a
pacman -Syu --noconfirm

msystem:
strategy:
matrix:
task: [ MSYS, MINGW64, MINGW32 ]
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: install deps
run: npm ci
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- name: run action
uses: ./
with:
Expand All @@ -89,38 +122,79 @@ jobs:

update:
strategy:
fail-fast: false
max-parallel: 3
matrix:
task: [ MSYS, MINGW64, MINGW32 ]
msystem: [ MSYS, MINGW64, MINGW32 ]
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: install deps
run: npm ci
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- name: run action
uses: ./
with:
update: True
msystem: ${{ matrix.task }}
- run: msys2do ./test.sh ${{ matrix.task }}
update: true
msystem: ${{ matrix.msystem }}
- run: msys2do ./test.sh ${{ matrix.msystem }}

MSYS2_PATH_TYPE:
runs-on: windows-latest
steps:
- uses: actions/setup-go@v1
- uses: actions/checkout@v1
- run: yarn
- uses: ./
- run: msys2do go env
env:
MSYS2_PATH_TYPE: inherit
- uses: actions/setup-go@v1
- uses: actions/checkout@v1
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- name: run action
uses: ./
- run: msys2do go env
env:
MSYS2_PATH_TYPE: inherit

path-type:
runs-on: windows-latest
steps:
- uses: actions/setup-go@v1
- uses: actions/checkout@v1
- run: yarn
- uses: ./
with:
path-type: inherit
- run: msys2do go env
- uses: actions/setup-go@v1
- uses: actions/checkout@v1
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- name: run action
uses: ./
with:
path-type: inherit
- run: msys2do go env

install:
strategy:
fail-fast: false
max-parallel: 3
matrix:
install: [ false, git, 'base-devel git' ]
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: build action
shell: bash
run: |
npm ci
npm run pkg
rm -rf node_modules
- name: run action
uses: ./
with:
update: true
install: ${{ matrix.install }}
msystem: MINGW64
- run: msys2do ./test.sh MINGW64
44 changes: 32 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
# Setup MSYS2

<p align="center">
<a title="Dependency Status" href="https://david-dm.org/numworks/setup-msys2"><img src="https://img.shields.io/david/numworks/setup-msys2.svg?longCache=true&logo=npm&label=deps"></a><!--
<a title="Dependency Status" href="https://david-dm.org/eine/setup-msys2"><img src="https://img.shields.io/david/eine/setup-msys2.svg?longCache=true&logo=npm&label=deps"></a><!--
-->
<a title="'action' workflow Status" href="https://github.com/numworks/setup-msys2/actions"><img alt="'action' workflow Status" src="https://github.com/numworks/setup-msys2/workflows/action/badge.svg"></a>
<a title="'action' workflow Status" href="https://github.com/eine/setup-msys2/actions"><img alt="'action' workflow Status" src="https://github.com/eine/setup-msys2/workflows/action/badge.svg"></a>
</p>

**setup-msys2** is a JavaScript GitHub Action (GHA) to setup a full-featured [MSYS2](https://www.msys2.org/) environment, using the GHA [toolkit](https://github.com/actions/toolkit).

The latest tarball available at [repo.msys2.org/distrib/x86_64](http://repo.msys2.org/distrib/x86_64/) is cached. Using the action extracts it and provides an entrypoint named `msys2do`.
The latest tarball available at [repo.msys2.org/distrib/x86_64](http://repo.msys2.org/distrib/x86_64/) is cached. Using the action extracts it and provides two entrypoints named `msys2` and `msys2do`.

## Usage

```yaml
- uses: numworks/setup-msys2@v1
- uses: eine/setup-msys2@v0
- shell: msys2 {0}
run: |
uname -a
```

```yaml
- uses: eine/setup-msys2@v0
- run: msys2do uname -a
```

Expand All @@ -24,19 +31,21 @@ The latest tarball available at [repo.msys2.org/distrib/x86_64](http://repo.msys
By default, `MSYSTEM` is set to `MINGW64`. However, an optional parameter named `msystem` is supported, which expects `MSYS`, `MINGW64` or `MING32`. For example:

```yaml
- uses: numworks/setup-msys2@v1
- uses: eine/setup-msys2@v0
with:
msystem: MSYS
```

Furthermore, the environment variable can be overriden. This is useful when multiple commands need to be executed in different contexts. For example, in order to build a PKGBUILD file and then test the installed artifact:

```yaml
- uses: numworks/setup-msys2@v1
- uses: eine/setup-msys2@v0
with:
msystem: MSYS
- run: msys2do makepkg-mingw -sCLfc --noconfirm --noprogressbar
- run: msys2do pacman --noconfirm -U mingw-w64-*-any.pkg.tar.xz
- shell: msys2
run: |
makepkg-mingw -sCLfc --noconfirm --noprogressbar
pacman --noconfirm -U mingw-w64-*-any.pkg.tar.xz
- run: |
set MSYSTEM=MINGW64
msys2do <command to test the package>
Expand All @@ -47,25 +56,36 @@ Furthermore, the environment variable can be overriden. This is useful when mult
By default, `MSYS2_PATH_TYPE` is set to `strict` by `msys2do`. It is possible to override it either using an option or setting the environment variable explicitly:

```yaml
- uses: numworks/setup-msys2@v1
- uses: eine/setup-msys2@v0
with:
path-type: inherit
- run: msys2do <command>
```

```yaml
- uses: numworks/setup-msys2@v1
- uses: eine/setup-msys2@v0
- run: msys2do <command>
env:
MSYS2_PATH_TYPE: inherit
```

#### update

By default, the installation is not updated; hence package versions are those of the installation tarball. By setting option `update` to `true`, the action will execute `pacman -Syu --no-confirm`:
By default, the installation is not updated; hence package versions are those of the installation tarball. By setting option `update` to `true`, the action will try to update the runtime and packages cleanly:

```yaml
- uses: eine/setup-msys2@v0
with:
update: true
```

#### install

Installing additional packages after updating the system is supported through option `install`. The package or list of packages are intalled through `pacman --noconfirm -S`.

```yaml
- uses: numworks/setup-msys2@v1
- uses: eine/setup-msys2@v0
with:
update: true
install: 'git base-devel'
```
9 changes: 6 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: 'Setup Msys2 environment'
description: 'Setup an Msys2 environment and provide an msys2do helper'
author: 'NumWorks'
name: 'Setup MSYS2 environment'
description: 'Setup an MSYS2 environment'
inputs:
msystem:
description: 'Variant of the environment to set by default: MSYS, MINGW32 or MINGW64'
Expand All @@ -14,6 +13,10 @@ inputs:
description: 'Update MSYS2 installation through pacman'
required: false
default: false
install:
description: 'Install packages after installation through pacman'
required: false
default: false
runs:
using: 'node12'
main: 'index.js'
49 changes: 0 additions & 49 deletions index.js

This file was deleted.

Loading