mirror of
https://github.com/flarum/core.git
synced 2025-02-19 15:44:56 +01:00
Move to GitHub Actions (#1853)
This commit is contained in:
parent
085468382a
commit
3851d805f7
16
.github/workflows/build.yml
vendored
Normal file
16
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
name: JavaScript
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
- uses: flarum/action-build@master
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
41
.github/workflows/test.yml
vendored
Normal file
41
.github/workflows/test.yml
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
name: Tests
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
php: [7.1, 7.2, 7.3]
|
||||
db: ['mysql:5.7', mariadb]
|
||||
|
||||
services:
|
||||
mysql:
|
||||
image: ${{ matrix.db }}
|
||||
ports:
|
||||
- 13306:3306
|
||||
|
||||
name: PHP ${{ matrix.php }} with ${{ matrix.db }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: Select PHP version
|
||||
run: sudo update-alternatives --set php $(which php${{ matrix.php }})
|
||||
|
||||
- name: Create MySQL Database
|
||||
run: mysql -uroot -proot -e 'CREATE DATABASE flarum_test;' --port 13306
|
||||
|
||||
- name: Install Composer dependencies
|
||||
run: composer install
|
||||
|
||||
- name: Setup Composer tests
|
||||
run: composer test:setup
|
||||
env:
|
||||
DB_PORT: 13306
|
||||
DB_PASSWORD: root
|
||||
|
||||
- name: Run Composer tests
|
||||
run: composer test
|
77
.travis.yml
77
.travis.yml
@ -1,77 +0,0 @@
|
||||
language: php
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
- $HOME/.npm
|
||||
|
||||
install:
|
||||
- composer install
|
||||
- mysql -e 'CREATE DATABASE flarum_test;'
|
||||
|
||||
before_script:
|
||||
- echo 'error_reporting = E_ALL' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
|
||||
|
||||
script:
|
||||
- composer test:setup
|
||||
- composer test
|
||||
|
||||
jobs:
|
||||
include:
|
||||
- php: 7.1
|
||||
services:
|
||||
- mysql
|
||||
env: DB=mysql
|
||||
|
||||
- php: 7.2
|
||||
services:
|
||||
- mysql
|
||||
env: DB=mysql
|
||||
|
||||
- php: 7.3
|
||||
services:
|
||||
- mysql
|
||||
env: DB=mysql
|
||||
|
||||
- php: 7.1
|
||||
addons:
|
||||
mariadb: '10.2'
|
||||
env: DB=mariadb
|
||||
|
||||
- php: 7.2
|
||||
addons:
|
||||
mariadb: '10.2'
|
||||
env: DB=mariadb
|
||||
|
||||
- php: 7.3
|
||||
addons:
|
||||
mariadb: '10.2'
|
||||
env: DB=mariadb
|
||||
|
||||
- php: 7.2
|
||||
services:
|
||||
- mysql
|
||||
env: DB=mysql PREFIX=forum_
|
||||
|
||||
- php: 7.4snapshot
|
||||
services:
|
||||
- mysql
|
||||
env: DB=mysql
|
||||
|
||||
- php: 7.4snapshot
|
||||
addons:
|
||||
mariadb: '10.2'
|
||||
env: DB=mariadb
|
||||
|
||||
- stage: build
|
||||
language: generic
|
||||
if: branch = master AND type = push
|
||||
install: skip
|
||||
script: bash .travis/build.sh
|
||||
-k $encrypted_678139e2bc67_key
|
||||
-i $encrypted_678139e2bc67_iv
|
||||
after_success: skip
|
||||
|
||||
matrix:
|
||||
allow_failures:
|
||||
- php: 7.4snapshot
|
@ -1,33 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
main() {
|
||||
while getopts ":k:i:" opt; do
|
||||
case $opt in
|
||||
k) encrypted_key="$OPTARG"
|
||||
;;
|
||||
i) encrypted_iv="$OPTARG"
|
||||
;;
|
||||
\?) echo "Invalid option -$OPTARG" >&2
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
git checkout -f $TRAVIS_BRANCH
|
||||
git config user.name "flarum-bot"
|
||||
git config user.email "bot@flarum.org"
|
||||
|
||||
cd js
|
||||
npm i -g npm@6.1.0
|
||||
npm ci
|
||||
npm run build
|
||||
|
||||
git add dist/* -f
|
||||
git commit -m "Bundled output for commit $TRAVIS_COMMIT [skip ci]"
|
||||
|
||||
eval `ssh-agent -s`
|
||||
openssl aes-256-cbc -K $encrypted_key -iv $encrypted_iv -in ../.deploy.enc -d | ssh-add -
|
||||
|
||||
git push git@github.com:$TRAVIS_REPO_SLUG.git $TRAVIS_BRANCH
|
||||
}
|
||||
|
||||
main "$@"
|
Loading…
x
Reference in New Issue
Block a user