Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tomusborne committed Sep 5, 2023
1 parent 1cb152d commit ad7b4ee
Showing 1 changed file with 65 additions and 0 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
Expand Down Expand Up @@ -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/[email protected]
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
Expand Down

0 comments on commit ad7b4ee

Please sign in to comment.