zip/README.md

67 lines
1.6 KiB
Markdown
Raw Normal View History

2019-07-18 07:03:22 -04:00
# Zip Files Action
2020-03-16 07:29:54 -04:00
This GitHub action exposes the zip command for use in building/archiving. It is important to note that this action currently only supports Linux.
2019-07-18 07:03:22 -04:00
## Usage
Zipping the directory `dir` into `dir.zip`:
2019-07-18 07:03:22 -04:00
```yaml
- uses: montudor/action-zip@v0.1.0
with:
args: zip -qq -r dir.zip dir
2019-07-18 07:03:22 -04:00
```
Unzipping a `dir.zip` file:
```yaml
- uses: montudor/action-zip@v0.1.0
with:
args: unzip -qq dir.zip -d dir
```
Reusing the same zip between steps in a `PHP` CI with unit and mutation tests:
```yaml
name: Continuous Integration
on:
push:
pull_request:
jobs:
composer-install:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: composer install --ansi --no-progress --no-interaction --prefer-dist
- uses: montudor/action-zip@v0.1.0
with:
args: zip -qq -r vendor.zip vendor
- uses: actions/upload-artifact@v2
with:
name: vendor.zip
tests:
needs: composer-install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/download-artifact@v2
with:
name: vendor.zip
- uses: montudor/action-zip@v0.1.0
with:
args: unzip -qq vendor.zip -d vendor
- run: ./vendor/bin/phpunit
mutation:
needs: composer-install
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/download-artifact@v2
with:
name: vendor.zip
- uses: montudor/action-zip@v0.1.0
with:
args: unzip -qq vendor.zip -d vendor
- run: ./vendor/bin/infection
2019-07-18 07:03:22 -04:00
```