Skip to content

Commit

Permalink
CI: replace Travis with GH Actions
Browse files Browse the repository at this point in the history
This translates the existing Travis workflow to a GH Actions workflow.

Effectively it is the same workflow.

At a detail level, there are the following differences:
* The commands to download Phive have been removed in favour of letting the `setup-php` action install it automatically.
* A build against PHP 8.0 has been added which is not allowed to fail.
* A build against PHP 8.1 has been added, which is (allowed to fail).

The build against PHP 8.1 also _does_ currently fail, but this is due to a PHP 8.1 incompatibility in Phive.
This issue has been reported in phar-io/phive#319 and :fingers_crossed: phar-io/phive#320 should fix it.
  • Loading branch information
jrfnl authored and theseer committed Jul 24, 2021
1 parent b9bee94 commit c9a14b8
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 26 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test

on:
# Run on all pushes and on all pull requests.
push:
pull_request:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-latest

strategy:
# Keys:
# - experimental: Whether the build is "allowed to fail".
matrix:
php: ['7.2', '7.3', '7.4', '8.0']
experimental: [false]

include:
# Nightly.
- php: '8.1'
experimental: true

name: "PHP: ${{ matrix.php }}"

continue-on-error: ${{ matrix.experimental }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
coverage: none
tools: phive

- name: Install java
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
uses: "ramsey/composer-install@v1"

- name: Lint the code
run: ant lint

- name: Install tools
run: ant install-tools

- name: Run unit tests
run: ./tools/phpunit --configuration phpunit.xml.dist
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

0 comments on commit c9a14b8

Please sign in to comment.