Skip to content

Commit

Permalink
Merge branch 'master' into v0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurHoaro committed Mar 18, 2023
2 parents 1409f1c + 9e24bb3 commit 6d73e49
Show file tree
Hide file tree
Showing 249 changed files with 12,663 additions and 4,255 deletions.
2 changes: 1 addition & 1 deletion .docker/services.d/php-fpm/run
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/execlineb -P
php-fpm7 -F
php-fpm8 -F
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
.github
.gitattributes
.gitignore
.travis.yml
tests

# Docker related resources are not needed inside the container
Expand Down
100 changes: 100 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Shaarli CI
on: [push, pull_request]
jobs:
php:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
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@v3

- 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 && \
composer remove --dev phpunit/phpunit && \
composer require --dev phpunit/php-text-template ^2.0 && \
composer require --dev 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-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '14.x'

- name: Yarn install
run: yarnpkg install

- name: Verify successful frontend builds
run: yarnpkg run build

- name: JS static analysis
run: make eslint

- name: Linter for SASS syntax
run: make sasslint

python:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8

- name: Install dependencies
run: pip install mkdocs

- name: Build documentation
run: mkdocs build --clean
42 changes: 42 additions & 0 deletions .github/workflows/docker-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build/push Docker image (master/latest)
on:
push:
branches: [ master ]
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout
uses: actions/checkout@v3

- name: Set shaarli version to the latest commit hash
run: sed -i "s/dev/$(git rev-parse --short HEAD)/" shaarli_version.php

- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: |
shaarli/shaarli:latest
ghcr.io/shaarli/shaarli:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
42 changes: 42 additions & 0 deletions .github/workflows/docker-tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build/push Docker image (tags/releases)
on:
push:
tags:
- "v*.*.*"
branches:
- "v*.*"
- release
jobs:
docker-build:
runs-on: ubuntu-latest
steps:
- name: Get the tag name
run: echo "REF=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v3
with:
push: true
tags: |
shaarli/shaarli:${{ env.REF }}
ghcr.io/shaarli/shaarli:${{ env.REF }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,20 @@ coverage
sandbox
phpmd.html
phpdoc.xml
.phpunit.result.cache

# User plugin configuration
plugins/*
!addlink_toolbar
!archiveorg
!default_colors
!demo_plugin
!isso
!piwik
!playvideos
!pubsubhubbub
!qrcode
!wallabag
plugins/*/config.php
plugins/default_colors/default_colors.css

Expand Down
68 changes: 0 additions & 68 deletions .travis.yml

This file was deleted.

Loading

0 comments on commit 6d73e49

Please sign in to comment.