daux.io/.github/workflows/php.yml

86 regels
2.3 KiB
YAML

2019-11-14 08:17:17 +01:00
name: CI
on: [push]
jobs:
build:
2019-11-14 08:26:13 +01:00
strategy:
max-parallel: 15
matrix:
2019-11-14 08:30:21 +01:00
# TODO : enable tests on windows
operating-system: [ubuntu-latest, macOS-latest]
2019-11-28 22:36:26 +01:00
php-versions: ['7.2', '7.3', '7.4']
2019-11-28 23:41:53 +01:00
exclude:
2019-11-28 23:44:24 +01:00
- operating-system: macos-latest
2019-11-28 23:41:53 +01:00
php-versions: 7.4
2019-11-14 08:17:17 +01:00
2019-11-14 08:26:13 +01:00
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
runs-on: ${{ matrix.operating-system }}
2019-11-14 08:17:17 +01:00
steps:
2020-04-22 23:17:36 +02:00
- uses: actions/checkout@v2
2019-11-14 08:17:17 +01:00
2019-11-14 08:26:13 +01:00
- name: Setup PHP
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
2019-12-29 20:56:55 +01:00
extension-csv: mbstring, dom, intl
2019-11-14 08:26:13 +01:00
2019-11-14 08:17:17 +01:00
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
2020-04-22 23:17:36 +02:00
- name: Install tools
2020-04-22 21:39:15 +02:00
run: ./scripts/install_tools.sh
2019-11-14 08:17:17 +01:00
- name: Run test suite
run: composer run-script test
2019-11-28 22:36:26 +01:00
2020-04-22 23:17:36 +02:00
sonarcloud:
name: "SonarCloud"
2019-11-28 22:36:26 +01:00
runs-on: ubuntu-latest
if: github.event_name != 'pull_request'
steps:
2020-04-23 22:19:12 +02:00
- uses: actions/checkout@v1
2019-11-28 22:36:26 +01:00
- name: Setup PHP
uses: shivammathur/setup-php@master
with:
php-version: 7.4
2020-04-22 23:17:36 +02:00
extension-csv: mbstring, dom, intl
coverage: pcov
2019-11-28 22:36:26 +01:00
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
2020-04-22 21:39:15 +02:00
- name: Install tools
run: ./scripts/install_tools.sh
2019-11-28 22:36:26 +01:00
- name: Run test suite
2020-04-22 23:17:36 +02:00
run: composer run-script test -- --coverage-clover=coverage.clover --log-junit=test-report.xml
2019-11-28 22:36:26 +01:00
2020-04-23 22:19:12 +02:00
- name: Fix reports
run: scripts/fix_reports.sh
2020-04-22 23:23:39 +02:00
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@v1.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
documentation:
runs-on: ubuntu-latest
if: github.repository == 'dauxio/daux.io' && github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
steps:
2020-04-22 23:17:36 +02:00
- uses: actions/checkout@v2
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Generate documentation
2019-11-28 23:41:53 +01:00
run: bin/daux generate
- uses: JamesIves/github-pages-deploy-action@2.0.3
env:
FOLDER: "static"
BRANCH: gh-pages
2020-04-22 21:39:15 +02:00
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}