2021-05-23 11:36:24 +02:00
|
|
|
name: Shaarli CI
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
|
|
php:
|
2023-03-17 02:22:20 +01:00
|
|
|
runs-on: ubuntu-latest
|
2021-05-23 11:36:24 +02:00
|
|
|
strategy:
|
2022-09-24 18:06:52 +02:00
|
|
|
fail-fast: false
|
2021-05-23 11:36:24 +02:00
|
|
|
matrix:
|
2023-03-18 19:27:41 +01:00
|
|
|
php-versions: ['7.4', '8.0', '8.1', '8.2']
|
2021-05-23 11:36:24 +02:00
|
|
|
name: PHP ${{ matrix.php-versions }}
|
|
|
|
steps:
|
|
|
|
- name: Set locales
|
|
|
|
run: |
|
|
|
|
sudo locale-gen de_DE.utf8 && \
|
|
|
|
sudo locale-gen en_US.utf8 && \
|
|
|
|
sudo locale-gen fr_FR.utf8 && \
|
|
|
|
sudo dpkg-reconfigure --frontend=noninteractive locales
|
|
|
|
|
|
|
|
- name: Install Gettext
|
|
|
|
run: sudo apt-get install gettext
|
|
|
|
|
|
|
|
- name: Checkout
|
2023-03-17 02:22:20 +01:00
|
|
|
uses: actions/checkout@v3
|
2021-05-23 11:36:24 +02:00
|
|
|
|
|
|
|
- name: Setup PHP
|
|
|
|
uses: shivammathur/setup-php@v2
|
|
|
|
with:
|
|
|
|
php-version: ${{ matrix.php-versions }}
|
|
|
|
extensions: gd, xml, curl, mbstring, intl, gettext
|
|
|
|
tools: composer:v2
|
|
|
|
|
|
|
|
- name: Check PHP version
|
|
|
|
run: php -v
|
|
|
|
|
|
|
|
- name: Setup Composer from PHP version + update
|
|
|
|
run: composer config --unset platform && composer config platform.php ${{ matrix.php-versions }}
|
|
|
|
|
|
|
|
- name: Update dependencies for PHP 8.x
|
|
|
|
if: ${{ matrix.php-versions == '8.0' || matrix.php-versions == '8.1' }}
|
|
|
|
run: |
|
2023-01-31 14:34:13 +01:00
|
|
|
composer update && \
|
|
|
|
composer remove --dev phpunit/phpunit && \
|
|
|
|
composer require --dev phpunit/php-text-template ^2.0 && \
|
|
|
|
composer require --dev phpunit/phpunit ^9.0
|
2021-05-23 11:36:24 +02:00
|
|
|
|
|
|
|
- name: Update dependencies for PHP 7.x
|
|
|
|
if: ${{ matrix.php-versions != '8.0' && matrix.php-versions != '8.1' }}
|
|
|
|
run: composer update
|
|
|
|
|
|
|
|
- name: Clean up
|
|
|
|
run: make clean
|
|
|
|
|
|
|
|
- name: Check permissions
|
|
|
|
run: make check_permissions
|
|
|
|
|
|
|
|
- name: Run PHPCS
|
|
|
|
run: make code_sniffer
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
run: make all_tests
|
|
|
|
|
|
|
|
node:
|
2023-03-17 02:22:20 +01:00
|
|
|
runs-on: ubuntu-latest
|
2021-05-23 11:36:24 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-03-17 02:22:20 +01:00
|
|
|
uses: actions/checkout@v3
|
2021-05-23 11:36:24 +02:00
|
|
|
|
|
|
|
- name: Setup Node.js
|
2023-03-17 02:22:20 +01:00
|
|
|
uses: actions/setup-node@v3
|
2021-05-23 11:36:24 +02:00
|
|
|
with:
|
|
|
|
node-version: '14.x'
|
|
|
|
|
|
|
|
- name: Yarn install
|
2022-04-06 19:26:01 +02:00
|
|
|
run: yarnpkg install
|
2021-05-23 11:36:24 +02:00
|
|
|
|
|
|
|
- name: Verify successful frontend builds
|
2022-04-06 19:26:01 +02:00
|
|
|
run: yarnpkg run build
|
2021-05-23 11:36:24 +02:00
|
|
|
|
|
|
|
- name: JS static analysis
|
|
|
|
run: make eslint
|
|
|
|
|
|
|
|
- name: Linter for SASS syntax
|
|
|
|
run: make sasslint
|
|
|
|
|
|
|
|
python:
|
2023-03-17 02:22:20 +01:00
|
|
|
runs-on: ubuntu-latest
|
2021-05-23 11:36:24 +02:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2023-03-17 02:22:20 +01:00
|
|
|
uses: actions/checkout@v3
|
2021-05-23 11:36:24 +02:00
|
|
|
|
|
|
|
- name: Setup Python
|
2023-03-17 02:22:20 +01:00
|
|
|
uses: actions/setup-python@v4
|
2021-05-23 11:36:24 +02:00
|
|
|
with:
|
2023-03-17 02:22:20 +01:00
|
|
|
python-version: 3.8
|
2021-05-23 11:36:24 +02:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: pip install mkdocs
|
|
|
|
|
|
|
|
- name: Build documentation
|
|
|
|
run: mkdocs build --clean
|