zip/README.md
Ana María Martínez Gómez 3939e6da10
Improve README
- Fix typos: the directory is `dir` and not `vendor` in the first examples.
- The `upload/download artifact` action supports uploading/downloading a single
  file. Maybe it didn't at the point this was written, but it does in v2.
- Do not remove the downloaded artifact.
2020-08-25 15:00:40 +02:00

1.6 KiB

Zip Files Action

This GitHub action exposes the zip command for use in building/archiving. It is important to note that this action currently only supports Linux.

Usage

Zipping the directory dir into dir.zip:

- uses: montudor/action-zip@v0.1.0
  with:
    args: zip -qq -r dir.zip dir

Unzipping a dir.zip file:

- 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:

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