mirror of
https://github.com/montudor/action-zip.git
synced 2024-11-09 10:13:36 -05:00
commit
1104d072e2
1 changed files with 13 additions and 22 deletions
35
README.md
35
README.md
|
@ -4,27 +4,24 @@ This GitHub action exposes the zip command for use in building/archiving. It is
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
Zipping the directory `vendor` into `vendor.zip`:
|
Zipping the directory `dir` into `dir.zip`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: montudor/action-zip@v0.1.0
|
- uses: montudor/action-zip@v0.1.0
|
||||||
with:
|
with:
|
||||||
args: zip -qq -r ./dir.zip ./dir
|
args: zip -qq -r dir.zip dir
|
||||||
```
|
```
|
||||||
|
|
||||||
Unzipping a `vendor.zip` file:
|
Unzipping a `dir.zip` file:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: montudor/action-zip@v0.1.0
|
- uses: montudor/action-zip@v0.1.0
|
||||||
with:
|
with:
|
||||||
args: unzip -qq dir.zip -d ./dir
|
args: unzip -qq dir.zip -d dir
|
||||||
```
|
```
|
||||||
|
|
||||||
Reusing the same zip between steps in a `PHP` CI with unit and mutation tests:
|
Reusing the same zip between steps in a `PHP` CI with unit and mutation tests:
|
||||||
|
|
||||||
*Note that we're putting the zip in the `vendor-zip` directory, this is required
|
|
||||||
because the artifact upload/download expects a directory not a file.*
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: Continuous Integration
|
name: Continuous Integration
|
||||||
on:
|
on:
|
||||||
|
@ -36,40 +33,34 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- run: composer install --ansi --no-progress --no-interaction --prefer-dist
|
- run: composer install --ansi --no-progress --no-interaction --prefer-dist
|
||||||
- run: mkdir vendor-zip
|
|
||||||
- uses: montudor/action-zip@v0.1.0
|
- uses: montudor/action-zip@v0.1.0
|
||||||
with:
|
with:
|
||||||
args: zip -qq -r ./vendor-zip/vendor.zip ./vendor
|
args: zip -qq -r vendor.zip vendor
|
||||||
- uses: actions/upload-artifact@master
|
- uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: vendor
|
name: vendor.zip
|
||||||
path: vendor-zip
|
|
||||||
tests:
|
tests:
|
||||||
needs: composer-install
|
needs: composer-install
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- uses: actions/download-artifact@master
|
- uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: vendor
|
name: vendor.zip
|
||||||
path: vendor-zip
|
|
||||||
- uses: montudor/action-zip@v0.1.0
|
- uses: montudor/action-zip@v0.1.0
|
||||||
with:
|
with:
|
||||||
args: unzip -qq ./vendor-zip/vendor.zip -d ./vendor
|
args: unzip -qq vendor.zip -d vendor
|
||||||
- run: rm -Rf ./vendor-zip
|
|
||||||
- run: ./vendor/bin/phpunit
|
- run: ./vendor/bin/phpunit
|
||||||
mutation:
|
mutation:
|
||||||
needs: composer-install
|
needs: composer-install
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
- uses: actions/download-artifact@master
|
- uses: actions/download-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: vendor
|
name: vendor.zip
|
||||||
path: vendor-zip
|
|
||||||
- uses: montudor/action-zip@v0.1.0
|
- uses: montudor/action-zip@v0.1.0
|
||||||
with:
|
with:
|
||||||
args: unzip -qq ./vendor-zip/vendor.zip -d ./vendor
|
args: unzip -qq vendor.zip -d vendor
|
||||||
- run: rm -Rf ./vendor-zip
|
|
||||||
- run: ./vendor/bin/infection
|
- run: ./vendor/bin/infection
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue