Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to github actions 1 #844

Merged
merged 6 commits into from
Feb 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Build
on:
pull_request:
branches:
- master
- stable*

jobs:
node-build:
runs-on: ubuntu-latest
name: Javascript build
steps:
- uses: actions/checkout@master
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Make
run: make
43 changes: 43 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Lint
on: pull_request

jobs:
php-linters:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.2', '7.3', '7.4']
name: php${{ matrix.php-versions }} lint
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up php${{ matrix.php-versions }}
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
coverage: none
- name: Lint
run: composer run lint
- name: Download schema
run: wget https://apps.nextcloud.com/schema/apps/info.xsd
- name: Lint info.xml
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: ./appinfo/info.xml
xml-schema-file: ./info.xsd

node-linters:
runs-on: ubuntu-latest
name: ESLint
steps:
- uses: actions/checkout@master
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: npm install
run: npm ci
- name: eslint
run: npm run lint
env:
CI: true
78 changes: 78 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Test
on:
pull_request:
branches:
- master
- stable*

jobs:
php-test:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ['7.2', '7.3', '7.4']
name: php${{ matrix.php-versions }} test
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up php${{ matrix.php-versions }}
if: matrix.php-versions != '7.4'
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
coverage: none
- name: Set up php${{ matrix.php-versions }} with coverage
if: matrix.php-versions == '7.4'
uses: shivammathur/setup-php@master
with:
php-version: ${{ matrix.php-versions }}
coverage: xdebug
- name: Setup Nextcloud
run: |
mysql -u root -proot -e 'create database oc_autotest;'
mysql -u root -proot -e "CREATE USER 'oc_autotest'@'localhost' IDENTIFIED BY '';"
mysql -u root -proot -e "GRANT ALL ON oc_autotest.* TO 'oc_autotest'@'localhost';"
cd ..
git clone https://github.com/nextcloud/server.git --recursive --depth 1 -b master core
cp -r tasks core/apps/
php -f core/occ maintenance:install --database-name oc_autotest --database-user oc_autotest --admin-user admin --admin-pass admin --database mysql --database-pass=''
- name: Setup Tasks
run: |
cd ..
php -f ./core/occ app:enable tasks
# Enable app twice to check occ errors of registered commands
php -f core/occ app:enable tasks
cd core/apps/tasks
php ../../occ app:check-code tasks
- name: Test PHP
if: matrix.php-versions != '7.4'
run: |
cd ../core/apps/tasks
make test-php
# Check php test coverage and upload to codecov
- name: Test PHP with coverage
if: matrix.php-versions == '7.4'
run: |
cd ../core/apps/tasks
make test-php-coverage
bash <(curl -s https://codecov.io/bash) -cF php -t ${{ secrets.CODECOV_TOKEN }};

node-test:
runs-on: ubuntu-latest
name: Javascript test
steps:
- uses: actions/checkout@master
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: npm install
run: npm ci
- name: Set up Codecov
run: npm install -g codecov
- name: Test
run: npm run test
env:
CI: true
- name: Upload coverage
run: bash <(curl -s https://codecov.io/bash) -cF javascript -t ${{ secrets.CODECOV_TOKEN }};
125 changes: 0 additions & 125 deletions .travis.yml

This file was deleted.

12 changes: 12 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "nextcloud/tasks",
"description": "Lint config for nextcloud/tasks",
"license": "MIT",
"config": {
"optimize-autoloader": true,
"classmap-authoritative": true
},
"scripts": {
"lint": "find . -name \\*.php -not -path './vendor/*' -exec php -l \"{}\" \\;"
}
}
4 changes: 4 additions & 0 deletions tests/javascript/unit/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
env: {
jest: true
},
rules: {
"node/no-missing-import": ["off"],
"import/no-unresolved": ["off"],
}
}