Skip to content

Commit

Permalink
Merge pull request #129 from nextcloud/add-github-actions
Browse files Browse the repository at this point in the history
Add GitHub actions
  • Loading branch information
nickvergessen authored Apr 8, 2022
2 parents 087521c + 77fec76 commit d4c1590
Show file tree
Hide file tree
Showing 32 changed files with 5,245 additions and 176 deletions.
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 <[email protected]>
Expand Down
Loading

0 comments on commit d4c1590

Please sign in to comment.