Skip to content

Commit

Permalink
chore: update workflows from templates
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ <[email protected]>
  • Loading branch information
skjnldsv committed Dec 26, 2023
1 parent 3323ca2 commit 1fa4340
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 138 deletions.
20 changes: 6 additions & 14 deletions .github/workflows/appstore-build-publish.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# This workflow is adjusted compared to the one from the template to setup rust+cross
# 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: Build and publish app release

Expand All @@ -7,7 +10,7 @@ on:
types: [published]

env:
PHP_VERSION: 8.1
PHP_VERSION: 8.2

jobs:
build_and_publish:
Expand All @@ -17,14 +20,6 @@ jobs:
if: ${{ github.repository_owner == 'nextcloud-releases' }}

steps:
### Adjustments start ###
- uses: cachix/install-nix-action@v20
- uses: cachix/cachix-action@v12
with:
name: notify-push
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
### Adjustments end ###

- name: Check actor permission
uses: skjnldsv/check-actor-permission@e591dbfe838300c007028e1219ca82cc26e8d7c5 # v2.1
with:
Expand All @@ -40,9 +35,6 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: ${{ env.APP_NAME }}
### Adjustment start ###
fetch-depth: 0
### Adjustment end ###

- name: Get appinfo data
id: appinfo
Expand Down Expand Up @@ -74,7 +66,7 @@ jobs:
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"

- name: Set up php ${{ env.PHP_VERSION }}
uses: shivammathur/setup-php@81cd5ae0920b34eef300e1775313071038a53429 # v2
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/lint-info-xml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@

name: Lint info.xml

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

permissions:
contents: read
Expand All @@ -27,13 +21,13 @@ jobs:
name: info.xml lint
steps:
- name: Checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Download schema
run: wget https://raw.githubusercontent.com/nextcloud/appstore/master/nextcloudappstore/api/v1/release/info.xsd

- name: Lint info.xml
uses: ChristophWurst/xmllint-action@39155a91429af431d65fafc21fa52ba5c4f5cb71 # v1.1
uses: ChristophWurst/xmllint-action@36f2a302f84f8c83fceea0b9c59e1eb4a616d3c1 # v1.2
with:
xml-file: ./appinfo/info.xml
xml-schema-file: ./info.xsd
10 changes: 3 additions & 7 deletions .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,10 @@ jobs:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Get php version
id: versions
uses: icewind1991/nextcloud-version-matrix@334a77e02e5684ba9da35933db0d7110356bf3ba # v1.1.0

- name: Set up php${{ steps.versions.outputs.php-max }}
uses: shivammathur/setup-php@81cd5ae0920b34eef300e1775313071038a53429 # v2
- name: Set up php8.2
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
with:
php-version: ${{ steps.versions.outputs.php-max }}
php-version: 8.2
coverage: none
ini-file: development
env:
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,11 @@ concurrency:
cancel-in-progress: true

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
php-versions: ${{ steps.versions.outputs.php-versions }}
steps:
- name: Checkout app
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get version matrix
id: versions
uses: icewind1991/nextcloud-version-matrix@111919cfc7b388b7c02cac3c5d53627137adb89f # v1.0.0

php-lint:
runs-on: ubuntu-latest
needs: matrix
strategy:
matrix:
php-versions: ${{fromJson(needs.matrix.outputs.php-versions)}}
php-versions: [ '8.0', '8.1', '8.2', '8.3' ]

name: php-lint

Expand All @@ -40,7 +28,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@81cd5ae0920b34eef300e1775313071038a53429 # v2
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
Expand Down
24 changes: 7 additions & 17 deletions .github/workflows/phpunit-mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,6 @@ concurrency:
cancel-in-progress: true

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.versions.outputs.matrix }}
steps:
- name: Checkout app
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get version matrix
id: versions
uses: icewind1991/nextcloud-version-matrix@8238a96541a763c633c093b203f3c8a33fcee037 # v1.0.0
with:
matrix: '{"mysql-versions": ["8.1"]}'

changes:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -55,11 +42,14 @@ jobs:
phpunit-mysql:
runs-on: ubuntu-latest

needs: [changes, matrix]
needs: changes
if: needs.changes.outputs.src != 'false'

strategy:
matrix: ${{ fromJson(needs.matrix.outputs.matrix) }}
matrix:
php-versions: ['8.0', '8.1', '8.2', '8.3']
server-versions: ['master']
mysql-versions: ['8.1']

name: MySQL ${{ matrix.mysql-versions }} PHP ${{ matrix.php-versions }} Nextcloud ${{ matrix.server-versions }}

Expand Down Expand Up @@ -91,7 +81,7 @@ jobs:
path: apps/${{ env.APP_NAME }}

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@81cd5ae0920b34eef300e1775313071038a53429 # v2
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
with:
php-version: ${{ matrix.php-versions }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
Expand All @@ -116,7 +106,7 @@ jobs:
# Only run if phpunit config file exists
if: steps.check_composer.outputs.files_exists == 'true'
working-directory: apps/${{ env.APP_NAME }}
run: rm composer.lock && composer i
run: composer i

- name: Set up Nextcloud
env:
Expand Down
20 changes: 4 additions & 16 deletions .github/workflows/phpunit-oci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ concurrency:
cancel-in-progress: true

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
php-max: ${{ steps.versions.outputs.php-max-list }}
server-max: ${{ steps.versions.outputs.branches-max-list }}
steps:
- name: Checkout app
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get version matrix
id: versions
uses: icewind1991/nextcloud-version-matrix@c2bf575a3516752db5ce2915499d3f694885e2c7 # v1.0.0

changes:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -54,13 +42,13 @@ jobs:
phpunit-oci:
runs-on: ubuntu-22.04

needs: [changes, matrix]
needs: changes
if: needs.changes.outputs.src != 'false'

strategy:
matrix:
php-versions: ${{ fromJson(needs.matrix.outputs.php-max) }}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
php-versions: ['8.2']
server-versions: ['master']

services:
oracle:
Expand Down Expand Up @@ -102,7 +90,7 @@ jobs:
path: apps/${{ env.APP_NAME }}

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@81cd5ae0920b34eef300e1775313071038a53429 # v2
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
with:
php-version: ${{ matrix.php-versions }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
Expand Down
20 changes: 4 additions & 16 deletions .github/workflows/phpunit-pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ concurrency:
cancel-in-progress: true

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
php-max: ${{ steps.versions.outputs.php-max-list }}
server-max: ${{ steps.versions.outputs.branches-max-list }}
steps:
- name: Checkout app
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get version matrix
id: versions
uses: icewind1991/nextcloud-version-matrix@c2bf575a3516752db5ce2915499d3f694885e2c7 # v1.0.0

changes:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -54,13 +42,13 @@ jobs:
phpunit-pgsql:
runs-on: ubuntu-latest

needs: [changes, matrix]
needs: changes
if: needs.changes.outputs.src != 'false'

strategy:
matrix:
php-versions: ${{ fromJson(needs.matrix.outputs.php-max) }}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
php-versions: ['8.2']
server-versions: ['master']

services:
postgres:
Expand Down Expand Up @@ -92,7 +80,7 @@ jobs:
path: apps/${{ env.APP_NAME }}

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@81cd5ae0920b34eef300e1775313071038a53429 # v2
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
with:
php-version: ${{ matrix.php-versions }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
Expand Down
20 changes: 4 additions & 16 deletions .github/workflows/phpunit-sqlite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ concurrency:
cancel-in-progress: true

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
php-max: ${{ steps.versions.outputs.php-max-list }}
server-max: ${{ steps.versions.outputs.branches-max-list }}
steps:
- name: Checkout app
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get version matrix
id: versions
uses: icewind1991/nextcloud-version-matrix@c2bf575a3516752db5ce2915499d3f694885e2c7 # v1.0.0

changes:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -54,13 +42,13 @@ jobs:
phpunit-sqlite:
runs-on: ubuntu-latest

needs: [changes, matrix]
needs: changes
if: needs.changes.outputs.src != 'false'

strategy:
matrix:
php-versions: ${{ fromJson(needs.matrix.outputs.php-max) }}
server-versions: ${{ fromJson(needs.matrix.outputs.server-max) }}
php-versions: ['8.2']
server-versions: ['master']

steps:
- name: Set app env
Expand All @@ -81,7 +69,7 @@ jobs:
path: apps/${{ env.APP_NAME }}

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@81cd5ae0920b34eef300e1775313071038a53429 # v2
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
with:
php-version: ${{ matrix.php-versions }}
# https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#prerequisites-for-manual-installation
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-feedback.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ jobs:
Thank you for contributing to Nextcloud and we hope to hear from you soon!
days-before-feedback: 14
start-date: "2023-07-10"
exempt-authors: "${{ steps.scrape.outputs.users }},nextcloud-command,nextcloud-android-bot"
exempt-authors: "${{ steps.scrape.outputs.users }},nextcloud-command,nextcloud-android-bot,skjnldsv,datenangebot"
exempt-bots: true
28 changes: 8 additions & 20 deletions .github/workflows/psalm-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,33 @@ concurrency:
cancel-in-progress: true

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
ocp-matrix: ${{ steps.versions.outputs.ocp-matrix }}
steps:
- name: Checkout app
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Get version matrix
id: versions
uses: icewind1991/nextcloud-version-matrix@334a77e02e5684ba9da35933db0d7110356bf3ba # v1.1.0

static-analysis:
runs-on: ubuntu-latest
needs: matrix
strategy:
# do not stop on another job's failure
fail-fast: false
matrix: ${{ fromJson(needs.matrix.outputs.ocp-matrix) }}
matrix:
ocp-version: [ 'dev-master', 'dev-stable28', 'dev-stable27', 'dev-stable26' ]

name: Nextcloud ${{ matrix.ocp-version }}
name: static-psalm-analysis ${{ matrix.ocp-version }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up php${{ matrix.php-versions }}
uses: shivammathur/setup-php@81cd5ae0920b34eef300e1775313071038a53429 # v2
- name: Set up php8.2
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
with:
php-version: ${{ matrix.php-versions }}
php-version: 8.2
coverage: none
ini-file: development
extensions: redis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: rm composer.lock && composer i
run: composer i

- name: Install dependencies
run: rm composer.lock && composer require --dev nextcloud/ocp:${{ matrix.ocp-version }} --ignore-platform-reqs --with-dependencies
run: composer require --dev nextcloud/ocp:${{ matrix.ocp-version }} --ignore-platform-reqs --with-dependencies

- name: Run coding standards check
run: composer run psalm
Expand Down
Loading

0 comments on commit 1fa4340

Please sign in to comment.