Skip to content

Commit

Permalink
Remove support of PHP < 8.0 (#58)
Browse files Browse the repository at this point in the history
* Remove support of PHP < 8.0

* More changes

* Add version 5 action
  • Loading branch information
whikloj authored Jan 17, 2024
1 parent 684410a commit 8aed900
Show file tree
Hide file tree
Showing 7 changed files with 3,282 additions and 5 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/v5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build version 5 development

on:
pull_request:
branches:
- "v5"

jobs:
build:
runs-on: ${{ matrix.host-os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php-versions: ["8.0", "8.1", "8.2", "8.3"]
host-os: ["ubuntu-latest", "windows-latest"]
experimental: [false]

name: PHP ${{ matrix.php-versions }} - OS ${{ matrix.host-os }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
extensions: sockets, intl, bz2, zip

- name: Get composer cache directory (Ubuntu)
id: composercache-ubuntu
run: |
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
if: ${{ startsWith( matrix.host-os , 'ubuntu') }}

- name: Cache dependencies (Ubuntu)
uses: actions/cache@v3
with:
path: ${{ steps.composercache-ubuntu.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
if: ${{ startsWith( matrix.host-os , 'ubuntu') }}

- name: Get composer cache directory (Windows)
id: composercache-windows
run: |
echo "dir=$(composer config cache-files-dir)" >> $env:GITHUB_OUTPUT
if: ${{ startsWith( matrix.host-os , 'windows') }}

- name: Cache dependencies (Windows)
uses: actions/cache@v3
with:
path: ${{ steps.composercache-windows.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
if: ${{ startsWith( matrix.host-os , 'windows') }}

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Check codestyle
run: composer check

- name: Run test suite
run: composer phpunit

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./clover.xml
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
vendor/
clover.xml
mytracedir/
.phpunit.result.cache
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BagItTools

[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%207.4-8892BF.svg?style=flat-square)](https://php.net/)
[![Minimum PHP Version](https://img.shields.io/badge/php-%3E%3D%208.0-8892BF.svg?style=flat-square)](https://php.net/)
[![Github Actions](https://github.com/whikloj/BagItTools/workflows/Build/badge.svg?branch=main)](https://github.com/whikloj/BagItTools/actions?query=workflow%3A%22Build%22+branch%3Amain)
[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](./LICENSE)
[![codecov](https://codecov.io/gh/whikloj/BagItTools/branch/main/graph/badge.svg)](https://codecov.io/gh/whikloj/BagItTools)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
],
"require": {
"pear/archive_tar": "^1.4.14",
"php": ">=7.4",
"php": ">=8.0",
"ext-curl": "*",
"ext-zip": "*",
"ext-mbstring": "*",
Expand Down
Loading

0 comments on commit 8aed900

Please sign in to comment.