Set up continuous integration using GitHub Actions

This also uses the unofficial Bash strict mode for shell scripts.
This commit is contained in:
Hugo Locurcio
2020-12-28 19:37:34 +01:00
parent 9c9e12a8e4
commit a1ae92b9ee
11 changed files with 141 additions and 8 deletions

52
.github/workflows/ci.yml vendored Normal file
View File

@@ -0,0 +1,52 @@
name: Continuous integration
on:
- push
- pull_request
jobs:
test:
name: Test
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2.3.4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.3'
tools: composer:v1
extensions: curl, fileinfo, gd, mbstring, openssl, pdo, pdo_mysql, xml, zip
# Disable Xdebug to improve performance.
coverage: none
- name: Install October and set up MySQL database
run: |
sudo systemctl start mysql
echo -e '[client]\nuser="root"\npassword="root"' > "$HOME/.my.cnf"
mysql -e 'CREATE DATABASE IF NOT EXISTS `database`;'
# https://stackoverflow.com/questions/52364415/php-with-mysql-8-0-error-the-server-requested-authentication-method-unknown-to
mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';"
mkdir -p october
pushd october
php -r "eval('?>'.file_get_contents('https://octobercms.com/api/installer'));"
php artisan key:generate
# Set up the database.
sed -i "s/'password' => ''/'password' => 'root'/g" config/database.php
sed -i "s/'activeTheme' => 'demo'/'activeTheme' => 'godotengine'/g" config/cms.php
php artisan october:up
cp -r ../plugins/* plugins
cp -r ../themes/* themes
php artisan plugin:refresh paulvonzimmerman.patreon
env -C plugins/paulvonzimmerman/patreon composer install
php artisan plugin:refresh pikanji.agent
php artisan plugin:refresh rainlab.blog
php artisan plugin:refresh serenitynow.cacheroute
php artisan plugin:refresh sobored.rss
- name: Run Lighthouse CI
run: |
npm install @lhci/cli@0.6.x
npx lhci autorun