diff options
Diffstat (limited to '.github')
-rw-r--r-- | .github/dependabot.yml | 2 | ||||
-rw-r--r-- | .github/pull_request_template.md | 12 | ||||
-rw-r--r-- | .github/workflows/api-integration-tests.yml | 31 | ||||
-rw-r--r-- | .github/workflows/api-php-static-code-check.yml | 16 | ||||
-rw-r--r-- | .github/workflows/api-php-tests.yml | 13 | ||||
-rw-r--r-- | .github/workflows/build-release.yml | 12 | ||||
-rw-r--r-- | .github/workflows/documentation.yml | 2 | ||||
-rw-r--r-- | .github/workflows/frontend-nodejs-tests.yml | 4 | ||||
-rw-r--r-- | .github/workflows/lint-eslint.yml | 25 | ||||
-rw-r--r-- | .github/workflows/lint.yml | 52 | ||||
-rw-r--r-- | .github/workflows/post-merge-tasks.yml | 14 | ||||
-rw-r--r-- | .github/workflows/updater-test.yml | 80 |
12 files changed, 203 insertions, 60 deletions
diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f863df114..fbf793116 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,7 +7,7 @@ version: 2 updates: # Maintain dependencies for npm - package-ecosystem: "npm" - directory: "/js" + directory: "/" schedule: interval: "daily" labels: diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..ff211fb84 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,12 @@ + +* Resolves: # <!-- related github issue --> + +## Summary + +<!-- your text --> + +## Checklist + +- Code is [properly formatted](https://nextcloud.github.io/news/developer/#coding-style-guidelines) +- [Sign-off message](https://github.com/src-d/guide/blob/master/developer-community/fix-DCO.md) is added to all commits +- Changelog entry added for all important changes. diff --git a/.github/workflows/api-integration-tests.yml b/.github/workflows/api-integration-tests.yml index eef085cac..0ab974e2a 100644 --- a/.github/workflows/api-integration-tests.yml +++ b/.github/workflows/api-integration-tests.yml @@ -16,7 +16,7 @@ jobs: name: "Integration: Nextcloud ${{ matrix.nextcloud }} - PHP ${{ matrix.php-versions }} - DB ${{ matrix.database }}" services: postgres: - image: postgres + image: postgres:14 env: POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} options: >- @@ -28,26 +28,22 @@ jobs: - 5432:5432 # Maps tcp port 5432 on service container to the host strategy: matrix: - php-versions: ['7.4', '8.0'] - nextcloud: ['stable22', 'stable23'] + php-versions: ['8.0', '8.1'] + nextcloud: ['stable27'] database: ['sqlite', 'pgsql', 'mysql'] experimental: [false] include: - - php-versions: '8.0' + - php-versions: 8.1 nextcloud: pre-release database: sqlite experimental: true - - php-versions: '8.1' + - php-versions: 8.2 nextcloud: pre-release database: sqlite experimental: true - - php-versions: 8.1 - nextcloud: stable24 - database: sqlite - experimental: false steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: recursive @@ -57,9 +53,11 @@ jobs: php-version: ${{ matrix.php-versions }} extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip coverage: none + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Setup BATS & httpie - run: sudo apt-get install -y bats httpie + run: sudo apt-get install -y httpie && npm install -g bats@1.7.0 ### MySQL specific setup - name: Setup mysql @@ -101,7 +99,7 @@ jobs: database-password: ${{ env.POSTGRES_PASSWORD }} - name: Prime app build - run: make + run: make composer - name: Configure server with app uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@main @@ -119,16 +117,13 @@ jobs: sleep 2 cd ${{ github.workspace }}/../server - + bats apps/news/tests/api # Kill php server kill %1 kill %2 - - name: Setup problem matchers for PHP - run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" - - name: Functional tests maintenance working-directory: ../server run: | @@ -142,9 +137,11 @@ jobs: sleep 2 cd ${{ github.workspace }}/../server - + bats apps/news/tests/command + kill %1 + - name: Prep PHP tests working-directory: ../server/apps/news run: make php-test-dependencies diff --git a/.github/workflows/api-php-static-code-check.yml b/.github/workflows/api-php-static-code-check.yml index 662aec0a1..9a37fc40c 100644 --- a/.github/workflows/api-php-static-code-check.yml +++ b/.github/workflows/api-php-static-code-check.yml @@ -7,28 +7,26 @@ jobs: continue-on-error: true strategy: matrix: - php-versions: [ '7.4', '8.0' ] - nextcloud: [ 'stable24' ] + php-versions: ['8.0', '8.1', '8.2' ] + nextcloud: [ 'stable27' ] database: [ 'sqlite' ] include: - - php-versions: 8.1 - nextcloud: stable24 - database: sqlite - experimental: false - - php-versions: 8.1 + - php-versions: 8.2 nextcloud: pre-release database: sqlite experimental: true name: "phpstan: Nextcloud ${{ matrix.nextcloud }} with ${{ matrix.php-versions }}" steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up php uses: shivammathur/setup-php@master with: php-version: ${{ matrix.php-versions }} extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip coverage: none + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Set up server non MySQL uses: SMillerDev/nextcloud-actions/setup-nextcloud@main @@ -38,7 +36,7 @@ jobs: database-type: ${{ matrix.database }} - name: Build app - run: make + run: make composer - name: Configure server with app uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@main diff --git a/.github/workflows/api-php-tests.yml b/.github/workflows/api-php-tests.yml index 6ff32bbb6..2fb790770 100644 --- a/.github/workflows/api-php-tests.yml +++ b/.github/workflows/api-php-tests.yml @@ -10,19 +10,19 @@ jobs: strategy: matrix: php-versions: ['8.1'] - nextcloud: ['stable24'] + nextcloud: ['stable27'] database: ['sqlite'] experimental: [false] codecoverage: [false] include: - - php-versions: 8.0 - nextcloud: stable24 + - php-versions: 8.2 + nextcloud: stable27 database: sqlite experimental: false codecoverage: true steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 2 # https://github.com/codecov/codecov-action/issues/190#issuecomment-790729633 @@ -32,6 +32,8 @@ jobs: php-version: ${{ matrix.php-versions }} extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip coverage: pcov + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ### Back to normal setup - name: Set up server non MySQL @@ -50,9 +52,6 @@ jobs: app: 'news' check-code: false - - name: Setup problem matchers for PHPUnit - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: Prep PHP tests working-directory: ../server/apps/news run: make php-test-dependencies diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 08484b600..c8f5a988a 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -15,21 +15,21 @@ jobs: strategy: matrix: php-versions: ['8.1'] - nextcloud: ['stable24'] + nextcloud: ['stable27'] database: ['sqlite'] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP - uses: shivammathur/setup-php@afefcaf556d98dc7896cca380e181decb609ca44 + uses: shivammathur/setup-php@7fdd3ece872ec7ec4c098ae5ab7637d5e0a96067 #2.26.0 with: php-version: ${{ matrix.php-versions }} extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip coverage: none - name: Set up server non MySQL - uses: SMillerDev/nextcloud-actions/setup-nextcloud@fae87e29aa7cdf1ea0b8033c67f60e75b10be2cd + uses: SMillerDev/nextcloud-actions/setup-nextcloud@1e38cb369e2193642279c64ee140fc93ddd4fa77 with: cron: false version: ${{ matrix.nextcloud }} @@ -39,7 +39,7 @@ jobs: run: make - name: Configure server with app - uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@fae87e29aa7cdf1ea0b8033c67f60e75b10be2cd + uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@1e38cb369e2193642279c64ee140fc93ddd4fa77 with: app: ${{ env.APP_NAME }} check-code: false @@ -52,7 +52,7 @@ jobs: app_public_crt: ${{ secrets.APP_PUBLIC_CRT }} - name: Upload app tarball to release - uses: svenstaro/upload-release-action@133984371c30d34e38222a64855679a414cb7575 + uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd id: attach_to_release with: repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 9b7022748..ddf60315f 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -12,7 +12,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout master - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Deploy docs uses: mhausenblas/mkdocs-deploy-gh-pages@master diff --git a/.github/workflows/frontend-nodejs-tests.yml b/.github/workflows/frontend-nodejs-tests.yml index d78409ae4..6b0cbbed9 100644 --- a/.github/workflows/frontend-nodejs-tests.yml +++ b/.github/workflows/frontend-nodejs-tests.yml @@ -10,12 +10,12 @@ jobs: strategy: matrix: php-versions: ['8.1'] - nextcloud: ['stable24'] + nextcloud: ['stable27'] database: ['sqlite'] experimental: [false] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/lint-eslint.yml b/.github/workflows/lint-eslint.yml index 564a4a829..2fd40e8dd 100644 --- a/.github/workflows/lint-eslint.yml +++ b/.github/workflows/lint-eslint.yml @@ -2,18 +2,17 @@ # # https://github.com/nextcloud/.github # https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization -# SPDX-FileCopyrightText: Nextcloud contributors -# SPDX-License-Identifier: AGPL-3.0-or-later name: Lint -on: - pull_request: - push: - branches: - - main - - master - - stable* +on: pull_request + +permissions: + contents: read + +concurrency: + group: lint-eslint-${{ github.head_ref || github.run_id }} + cancel-in-progress: true jobs: lint: @@ -23,17 +22,17 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Read package.json node and npm engines version - uses: skjnldsv/read-package-engines-version-actions@v1.2 + uses: skjnldsv/read-package-engines-version-actions@v3 id: versions with: - fallbackNode: '^12' + fallbackNode: '^16' fallbackNpm: '^6' - name: Set up node ${{ steps.versions.outputs.nodeVersion }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ steps.versions.outputs.nodeVersion }} diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..fd3a5bf8d --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,52 @@ +name: Lint + +on: + pull_request: + push: + branches: + - master + +jobs: + eslint: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + name: eslint node${{ matrix.node-versions }} + steps: + - uses: actions/checkout@v4 + + - name: Set up node ${{ matrix.node-versions }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-versions }} + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run lint + + stylelint: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + name: stylelint node${{ matrix.node-versions }} + steps: + - uses: actions/checkout@v4 + + - name: Set up node ${{ matrix.node-versions }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-versions }} + + - name: Install dependencies + run: npm ci + + - name: Lint + run: npm run stylelint diff --git a/.github/workflows/post-merge-tasks.yml b/.github/workflows/post-merge-tasks.yml index b431399c7..58859acec 100644 --- a/.github/workflows/post-merge-tasks.yml +++ b/.github/workflows/post-merge-tasks.yml @@ -7,18 +7,20 @@ jobs: php: runs-on: ubuntu-latest continue-on-error: false - name: "Coverage: Nextcloud PHP ${{ matrix.php-versions }}" + name: "Coverage: Nextcloud ${{ matrix.nextcloud }} PHP ${{ matrix.php-version }}" strategy: matrix: - nextcloud: ['stable24'] + nextcloud: ['stable27'] + codecoverage: [true] + php-version: ["8.1"] steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: ${{ matrix.php-version }} ### Back to normal setup - name: Set up server non MySQL @@ -39,7 +41,11 @@ jobs: - name: Prep PHP tests run: cd ../server/apps/news && make php-test-dependencies + - name: Unittests run: cd ../server/apps/news && make unit-test + env: + CODECOVERAGE: ${{ matrix.codecoverage }} + - name: Upload codecoverage run: cd ../server/apps/news && bash <(curl -s https://codecov.io/bash) -f build/php-unit.clover diff --git a/.github/workflows/updater-test.yml b/.github/workflows/updater-test.yml new file mode 100644 index 000000000..3f9b217ee --- /dev/null +++ b/.github/workflows/updater-test.yml @@ -0,0 +1,80 @@ +name: Updater Tests +on: + pull_request + +env: + POSTGRES_PASSWORD: nc_test_db + MYSQL_USER: nc_test + MYSQL_PASSWORD: nc_test_db + MYSQL_DATABASE: nc_test + MYSQL_PORT: 3800 + +jobs: + integration: + runs-on: ubuntu-latest + continue-on-error: ${{ matrix.experimental }} + name: "Update Test: Nextcloud ${{ matrix.nextcloud }} - PHP ${{ matrix.php-versions }}" + strategy: + matrix: + php-versions: ['8.1'] + nextcloud: ['stable27'] + database: ['sqlite'] + experimental: [false] + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: pdo_sqlite,pdo_mysql,pdo_pgsql,gd,zip + coverage: none + + - name: Setup BATS & httpie + run: sudo apt-get install -y httpie && npm install -g bats@1.7.0 + + - name: Set up server + uses: SMillerDev/nextcloud-actions/setup-nextcloud@main + with: + version: ${{ matrix.nextcloud }} + cron: true + database-type: ${{ matrix.database }} + database-host: localhost + database-port: 5432 + database-name: postgres + database-user: postgres + database-password: ${{ env.POSTGRES_PASSWORD }} + + - name: Prime app build + run: make + + - name: Configure server with app + uses: SMillerDev/nextcloud-actions/setup-nextcloud-app@main + with: + app: 'news' + check-code: false + force: ${{ matrix.experimental }} + + - name: Install composer install php-feed-generator + working-directory: ../server + run: composer install -d apps/news/tests/test_helper/php-feed-generator + + - name: Run Updater tests + working-directory: ../server + run: | + php -S localhost:8080 &> /tmp/webserver.log & + cd apps/news/tests/test_helper/feeds && php -S localhost:8090 &> /tmp/feedserver.log & + + sleep 2 + + cd ${{ github.workspace }}/../server + + bats apps/news/tests/updater + + # Kill php server + kill %1 + kill %2 + |