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

Add GitHub actions #129

Merged
merged 11 commits into from
Apr 8, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: weekly
day: saturday
time: "03:00"
timezone: Europe/Paris
open-pull-requests-limit: 10
labels:
- 3. to review
- dependencies
File renamed without changes.
29 changes: 29 additions & 0 deletions .github/workflows/dependabot-approve-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: Dependabot

on:
pull_request_target:
branches:
- master
- stable*

jobs:
auto-approve-merge:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest

steps:
# Github actions bot approve
- uses: hmarr/auto-approve-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

# Nextcloud bot approve and merge request
- uses: ahmadnassri/action-dependabot-auto-merge@v2
with:
target: minor
github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }}
32 changes: 32 additions & 0 deletions .github/workflows/lint-info-xml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: Lint

on:
pull_request:
push:
branches:
- main
- master
- stable*

jobs:
xml-linters:
runs-on: ubuntu-latest

name: info.xml lint
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Download schema
run: wget https://raw.githubusercontent.com/nextcloud/server/master/resources/app-info-shipped.xsd

- name: Lint info.xml
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: ./appinfo/info.xml
xml-schema-file: ./app-info-shipped.xsd
35 changes: 35 additions & 0 deletions .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: Lint

on:
pull_request:
push:
branches:
- master
- stable*

jobs:
lint:
runs-on: ubuntu-latest

name: php-cs

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
coverage: none

- name: Install dependencies
run: composer i

- name: Lint
run: composer run cs:check || ( echo 'Please run `composer run cs:fix` to format your code' && exit 1 )
47 changes: 47 additions & 0 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow is provided via the organization template repository
#
# https://github.com/nextcloud/.github
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization

name: Lint

on:
pull_request:
push:
branches:
- master
- stable*

jobs:
php-lint:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: ["7.4", "8.0", "8.1"]

name: php-lint

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none

- name: Lint
run: composer run lint

summary:
runs-on: ubuntu-latest
needs: php-lint

if: always()

name: php-lint-summary

steps:
- name: Summary status
run: if ${{ needs.php-lint.result != 'success' && needs.php-lint.result != 'skipped' }}; then exit 1; fi
39 changes: 39 additions & 0 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Static analysis

on: [pull_request]

jobs:
static-psalm-analysis:
runs-on: ubuntu-latest
strategy:
matrix:
ocp-version: [ 'dev-master' ]
name: Nextcloud ${{ matrix.ocp-version }}
steps:
- name: Checkout
uses: actions/checkout@master
- name: Set up php
uses: shivammathur/setup-php@master
with:
php-version: 7.4
tools: composer:v1
coverage: none
- name: Install dependencies
run: composer i
- name: Install dependencies
run: composer require --dev christophwurst/nextcloud:${{ matrix.ocp-version }}
- name: Run coding standards check
run: composer run psalm

summary:
runs-on: ubuntu-latest
needs: static-psalm-analysis

if: always()

name: static-psalm-analysis-summary

steps:
- name: Summary status
run: if ${{ needs.static-psalm-analysis.result != 'success' && needs.static-psalm-analysis.result != 'skipped' }}; then exit 1; fi

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ nbproject
# Tests - auto-generated files
/tests/coverage*
/tests/clover.xml
/vendor
.php-cs-fixer.cache

18 changes: 18 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

declare(strict_types=1);

require_once './vendor/autoload.php';

use Nextcloud\CodingStandard\Config;

$config = new Config();
$config
->getFinder()
->notPath('build')
->notPath('l10n')
->notPath('node_modules')
->notPath('src')
->notPath('vendor')
->in(__DIR__);
return $config;
65 changes: 0 additions & 65 deletions .travis.yml

This file was deleted.

68 changes: 38 additions & 30 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -1,32 +1,40 @@
<?xml version="1.0"?>
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>survey_client</id>
<name>Usage survey</name>
<summary>Sends anonymized data to Nextcloud to help us to improve Nextcloud.</summary>
<description>
Sends anonymized data to Nextcloud to help us to improve Nextcloud. You
always have full control over the content sent to Nextcloud and can disable
it again at any time.
</description>
<version>1.12.0</version>
<licence>agpl</licence>
<author>Björn Schiessle</author>
<author>Joas Schilling</author>
<namespace>Survey_Client</namespace>
<default_enable/>
<category>tools</category>
<website>https://github.com/nextcloud/survey_client</website>
<bugs>https://github.com/nextcloud/survey_client/issues</bugs>
<dependencies>
<nextcloud min-version="24" max-version="24" />
</dependencies>
<repair-steps>
<post-migration>
<step>OCA\Survey_Client\Migration\SendAdminNotification</step>
</post-migration>
</repair-steps>
<settings>
<admin>OCA\Survey_Client\Settings\AdminSettings</admin>
<admin-section>OCA\Survey_Client\Settings\AdminSection</admin-section>
</settings>
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>survey_client</id>
<name>Usage survey</name>
<summary>Sends anonymized data to Nextcloud to help us to improve Nextcloud.</summary>
<description>
Sends anonymized data to Nextcloud to help us to improve Nextcloud. You
always have full control over the content sent to Nextcloud and can disable
it again at any time.
</description>

<version>1.12.0</version>
<licence>agpl</licence>
<author>Björn Schiessle</author>
<author>Joas Schilling</author>

<namespace>Survey_Client</namespace>
<default_enable/>

<category>tools</category>

<website>https://github.com/nextcloud/survey_client</website>
<bugs>https://github.com/nextcloud/survey_client/issues</bugs>

<dependencies>
<nextcloud min-version="24" max-version="24" />
</dependencies>

<repair-steps>
<post-migration>
<step>OCA\Survey_Client\Migration\SendAdminNotification</step>
</post-migration>
</repair-steps>

<settings>
<admin>OCA\Survey_Client\Settings\AdminSettings</admin>
<admin-section>OCA\Survey_Client\Settings\AdminSection</admin-section>
</settings>
</info>
1 change: 1 addition & 0 deletions appinfo/routes.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

declare(strict_types=1);
/**
* @author Joas Schilling <coding@schilljs.com>
Expand Down
Loading