From ad7b4ee38de69415a434005133d3e8f89adae945 Mon Sep 17 00:00:00 2001 From: Tom Usborne Date: Tue, 5 Sep 2023 08:59:56 -0600 Subject: [PATCH] Update ci.yml --- .github/workflows/ci.yml | 65 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 138954b5..cd0d4ef8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,6 +57,38 @@ jobs: if: steps.js-files.outputs.any_changed == 'true' run: npm run lint:js + js-tests: + name: JS Tests + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Check changed files + id: 'js-files' + uses: tj-actions/changed-files@v35.4.3 + with: + files: | + src/**/*.js + src/**/*.json + + - name: Setup node + if: steps.js-files.outputs.any_changed == 'true' + uses: actions/setup-node@v3 + with: + node-version: 16 + cache: 'npm' + + - name: Download deps + if: steps.js-files.outputs.any_changed == 'true' + uses: bahmutov/npm-install@v1 + + - name: Run tests + if: steps.js-files.outputs.any_changed == 'true' + run: npm run test:unit + js-commit-dist: name: Commit dist files runs-on: ubuntu-latest @@ -134,6 +166,39 @@ jobs: if: steps.php-files.outputs.any_changed == 'true' run: composer run-script php + php-tests: + name: PHP Tests + runs-on: ubuntu-latest + strategy: + matrix: + php-versions: ['7.4'] + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Check changed files + id: 'php-files' + uses: tj-actions/changed-files@v35.4.3 + with: + files: | + **/*.php + + - name: Setup PHP + if: steps.php-files.outputs.any_changed == 'true' + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + + - name: Download deps + if: steps.php-files.outputs.any_changed == 'true' + uses: ramsey/composer-install@v2 + + - name: Test + if: steps.php-files.outputs.any_changed == 'true' + run: composer run-script test + build-package: name: Build package runs-on: ubuntu-latest