Skip to content

Commit

Permalink
Use Github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mrclay committed Jan 4, 2024
1 parent 4546378 commit e84d55d
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 55 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: PHP Composer

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions:
["8.1", "8.2", "8.3"]

name: PHP ${{ matrix.php-versions }} Test on ubantu-latest
steps:
- uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
tools: composer, wp-cli, phpunit-polyfills:1.0
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- 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') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --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 test
55 changes: 0 additions & 55 deletions .travis.yml

This file was deleted.

0 comments on commit e84d55d

Please sign in to comment.