From 4fd01a0f0875ff22e1d510d453f4261453414280 Mon Sep 17 00:00:00 2001 From: Leszek Manicki Date: Tue, 16 Jul 2024 21:27:01 +0200 Subject: [PATCH] Added github actions workflow to lint and test when pushing code --- .github/workflows/push.yaml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/push.yaml diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml new file mode 100644 index 0000000..c670c5a --- /dev/null +++ b/.github/workflows/push.yaml @@ -0,0 +1,33 @@ +name: Lint and Test + +on: push + +permissions: + contents: read + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Validate composer.json and composer.lock + run: composer validate --strict + + - name: Cache Composer packages + id: composer-cache + uses: actions/cache@v3 + with: + path: vendor + key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} + + - name: Install dependencies + run: composer install --prefer-source #--no-progress + + # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" + # Docs: https://getcomposer.org/doc/articles/scripts.md + + - name: Run test suite + run: composer run-script ci