Skip to content

Commit

Permalink
Upgrade github-actions (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b authored Dec 23, 2020
1 parent 26eb989 commit 4dd5bed
Show file tree
Hide file tree
Showing 8 changed files with 483 additions and 383 deletions.
61 changes: 0 additions & 61 deletions .circleci/config.yml

This file was deleted.

47 changes: 32 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,46 @@ name: CI
on: [push]

jobs:
build:
composer:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: php-actions/composer@v2
- name: Upload build for test runner
uses: actions/upload-artifact@v2
with:
name: build-artifact
path: ./

test:
- uses: actions/checkout@v2

- name: Cache Composer dependencies
uses: actions/cache@v2
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}

- uses: php-actions/composer@v5

- name: Archive build
run: mkdir /tmp/github-actions/ && tar -cvf /tmp/github-actions/build.tar ./

- name: Upload build archive for test runners
uses: actions/upload-artifact@v2
with:
name: build-artifact
path: /tmp/github-actions

phpunit:
runs-on: ubuntu-latest
needs: [build]
needs: [composer]

steps:
- uses: actions/download-artifact@v2
with:
name: build-artifact
path: ./
path: /tmp/github-actions

- name: Extract build archive
run: tar -xvf /tmp/github-actions/build.tar ./

- name: PHP Unit tests
uses: php-actions/phpunit@v9
uses: php-actions/phpunit@v2
with:
php_version: 8.0
php_extensions: xdebug
configuration: test/phpunit/phpunit.xml
bootstrap: vendor/autoload.php
31 changes: 20 additions & 11 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
build:
environment:
php:
version: 7.4.0
tests:
override:
- php-scrutinizer-run
- phpcs-run ./src
-
command: 'vendor/bin/phpunit test/phpunit --coverage-clover coverage --whitelist src'
coverage:
file: 'coverage'
format: 'php-clover'
php: 8.0.0

nodes:
analysis:
tests:
override:
- php-scrutinizer-run

tests-and-coverage:
environment:
php:
ini:
"xdebug.mode": coverage
tests:
override:
- phpcs-run ./src
- command: "vendor/bin/phpunit test/phpunit --coverage-clover test/phpunit/_coverage --whitelist src"
coverage:
file: "test/phpunit/_coverage"
format: "php-clover"

checks:
php:
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "phpgt/dom",
"description": "The modern DOM API for PHP 7 projects.",
"description": "The modern DOM API for PHP projects.",
"type": "library",

"require": {
"php": ">=7.2",
"ext-dom": "*",
"ext-libxml": "*",
"ext-mbstring": "*",
"phpgt/cssxpath": "*",
"phpgt/cssxpath": ">=1.1.2",
"psr/http-message": "1.*"
},

"require-dev": {
"phpunit/phpunit": "9.*"
"phpunit/phpunit": ">=9.3.8"
},

"license": "MIT",
Expand Down
Loading

0 comments on commit 4dd5bed

Please sign in to comment.