Setup Github Actions for Shaarli
This is kind of a quick & dirty setup in order to fix our non-CI current status. We can later decide to either improve it or fix Drone CI. Related to #1754
This commit is contained in:
parent
d8fe0e7276
commit
2ce2ef3708
2 changed files with 99 additions and 115 deletions
115
.drone.yml
115
.drone.yml
|
@ -1,115 +0,0 @@
|
|||
---
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: php-8.0
|
||||
|
||||
steps:
|
||||
- name: test-php-8.0
|
||||
image: shaarli/drone-ci-base:8.0
|
||||
commands:
|
||||
- composer config --unset platform && composer config platform.php 8.0
|
||||
- composer update --ignore-platform-req=php
|
||||
- composer remove --dev --ignore-platform-req=php phpunit/phpunit
|
||||
- composer require --dev --ignore-platform-req=php phpunit/php-text-template ^2.0
|
||||
- composer require --dev --ignore-platform-req=php phpunit/phpunit ^9.0
|
||||
- make clean
|
||||
- make check_permissions
|
||||
- make code_sniffer
|
||||
- make all_tests
|
||||
|
||||
---
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: php-7.4
|
||||
|
||||
steps:
|
||||
- name: test-php-7.4
|
||||
image: shaarli/drone-ci-base:7.4
|
||||
commands:
|
||||
- composer config --unset platform && composer config platform.php 7.4
|
||||
- composer update
|
||||
- make clean
|
||||
- make check_permissions
|
||||
- make code_sniffer
|
||||
- make all_tests
|
||||
|
||||
---
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: php-7.3
|
||||
|
||||
steps:
|
||||
- name: test-php-7.3
|
||||
image: shaarli/drone-ci-base:7.3
|
||||
commands:
|
||||
- composer config --unset platform && composer config platform.php 7.3
|
||||
- composer update
|
||||
- make clean
|
||||
- make check_permissions
|
||||
- make code_sniffer
|
||||
- make all_tests
|
||||
|
||||
---
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: php-7.2
|
||||
|
||||
steps:
|
||||
- name: test-php-7.2
|
||||
image: shaarli/drone-ci-base:7.2
|
||||
commands:
|
||||
- composer config --unset platform && composer config platform.php 7.2
|
||||
- composer update
|
||||
- make clean
|
||||
- make check_permissions
|
||||
- make code_sniffer
|
||||
- make all_tests
|
||||
|
||||
---
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: php-7.1
|
||||
|
||||
steps:
|
||||
- name: test-php-7.1
|
||||
image: shaarli/drone-ci-base:7.1
|
||||
commands:
|
||||
- composer config --unset platform && composer config platform.php 7.1
|
||||
- composer update
|
||||
- make clean
|
||||
- make check_permissions
|
||||
- make code_sniffer
|
||||
- make all_tests
|
||||
|
||||
---
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: node-10
|
||||
|
||||
steps:
|
||||
- name: test-node-10
|
||||
image: node:10
|
||||
commands:
|
||||
- yarn install
|
||||
- yarn run build # verify successful frontend builds
|
||||
- make eslint # javascript static analysis
|
||||
- make sasslint # linter for SASS syntax
|
||||
|
||||
---
|
||||
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: python-3.6
|
||||
|
||||
steps:
|
||||
- name: test-python-3.6
|
||||
image: python:3.6-slim
|
||||
commands:
|
||||
- pip install mkdocs
|
||||
- mkdocs build --clean
|
99
.github/workflows/ci.yml
vendored
Normal file
99
.github/workflows/ci.yml
vendored
Normal file
|
@ -0,0 +1,99 @@
|
|||
name: Shaarli CI
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
php:
|
||||
runs-on: ubuntu-18.04
|
||||
strategy:
|
||||
matrix:
|
||||
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
|
||||
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
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- 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: |
|
||||
composer update --ignore-platform-req=php && \
|
||||
composer remove --dev --ignore-platform-req=php phpunit/phpunit && \
|
||||
composer require --dev --ignore-platform-req=php phpunit/php-text-template ^2.0 && \
|
||||
composer require --dev --ignore-platform-req=php phpunit/phpunit ^9.0
|
||||
|
||||
- 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:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '14.x'
|
||||
|
||||
- name: Yarn install
|
||||
run: yarn install
|
||||
|
||||
- name: Verify successful frontend builds
|
||||
run: yarn run build
|
||||
|
||||
- name: JS static analysis
|
||||
run: make eslint
|
||||
|
||||
- name: Linter for SASS syntax
|
||||
run: make sasslint
|
||||
|
||||
python:
|
||||
runs-on: ubuntu-18.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v2
|
||||
with:
|
||||
node-version: 3.8
|
||||
|
||||
- name: Install dependencies
|
||||
run: pip install mkdocs
|
||||
|
||||
- name: Build documentation
|
||||
run: mkdocs build --clean
|
Loading…
Reference in a new issue