Skip to content

Commit

Permalink
Merge pull request #99 from nextcloud/automated/update-workflows/default
Browse files Browse the repository at this point in the history
chore: update workflows from templates
  • Loading branch information
mejo- authored Jan 15, 2024
2 parents da2b631 + f8feb1f commit d2e5daa
Show file tree
Hide file tree
Showing 17 changed files with 171 additions and 147 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/appstore-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
types: [published]

env:
PHP_VERSION: 8.1
PHP_VERSION: 8.2

jobs:
build_and_publish:
Expand All @@ -32,7 +32,7 @@ jobs:
echo "APP_VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: ${{ env.APP_NAME }}

Expand All @@ -56,7 +56,7 @@ jobs:
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
# Skip if no package.json
if: ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

Expand All @@ -66,7 +66,7 @@ jobs:
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"

- name: Set up php ${{ env.PHP_VERSION }}
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
with:
php-version: ${{ env.PHP_VERSION }}
coverage: none
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
unzip latest-$NCVERSION.zip
- name: Checkout server master fallback
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
if: ${{ steps.server-checkout.outcome != 'success' }}
with:
submodules: true
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/command-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
require: write

- name: Add reaction on start
uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa # v3.0.2
uses: peter-evans/create-or-update-comment@23ff15729ef2fc348714a3bb66d2f655ca9066f2 # v3.1.0
with:
token: ${{ secrets.COMMAND_BOT_PAT }}
repository: ${{ github.event.repository.full_name }}
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
key: git-repo

- name: Checkout ${{ needs.init.outputs.head_ref }}
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
token: ${{ secrets.COMMAND_BOT_PAT }}
fetch-depth: 0
Expand All @@ -79,7 +79,7 @@ jobs:
fallbackNpm: '^9'

- name: Set up node ${{ steps.package-engines-versions.outputs.nodeVersion }}
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v3
with:
node-version: ${{ steps.package-engines-versions.outputs.nodeVersion }}
cache: npm
Expand All @@ -90,6 +90,7 @@ jobs:
- name: Install dependencies & build
env:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_DOWNLOAD: true
run: |
npm ci
npm run build --if-present
Expand All @@ -116,7 +117,7 @@ jobs:
git push --force origin ${{ needs.init.outputs.head_ref }}
- name: Add reaction on failure
uses: peter-evans/create-or-update-comment@c6c9a1a66007646a28c153e2a8580a5bad27bcfa # v3.0.2
uses: peter-evans/create-or-update-comment@23ff15729ef2fc348714a3bb66d2f655ca9066f2 # v3.1.0
if: failure()
with:
token: ${{ secrets.COMMAND_BOT_PAT }}
Expand Down
46 changes: 11 additions & 35 deletions .github/workflows/cypress.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,14 @@
name: Cypress

on:
pull_request:
paths:
- '.github/workflows/**'
- 'appinfo/**'
- 'cypress/**'
- 'l10n/**'
- 'lib/**'
- 'src/**'
- 'templates/**'
- '.php-cs-fixer.dist.php'
- 'babel.config.js'
- 'composer.json'
- 'composer.lock'
- 'cypress.json'
- 'package.json'
- 'package-lock.json'

push:
branches:
- main
- master
- stable*

permissions:
contents: read
on: pull_request

concurrency:
group: cypress-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
APP_NAME: monthly_status_email
# Adjust APP_NAME if your repository name is different
APP_NAME: ${{ github.event.repository.name }}
CYPRESS_baseUrl: http://localhost:8081/index.php

jobs:
Expand All @@ -59,21 +35,21 @@ jobs:
echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV
- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, iconv, fileinfo, intl, sqlite, pdo_sqlite, gd
coverage: none

- name: Checkout server
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
submodules: true
repository: nextcloud/server
ref: ${{ matrix.server-versions }}

- name: Checkout app
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
path: apps/${{ env.APP_NAME }}

Expand All @@ -86,15 +62,15 @@ jobs:
fallbackNpm: '^9'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

- name: Set up npm ${{ steps.versions.outputs.npmVersion }}
run: npm i -g npm@"${{ steps.versions.outputs.npmVersion }}"

- name: Setup NPM cache
uses: actions/setup-node@v3
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
cache: 'npm'
cache-dependency-path: apps/${{ env.APP_NAME }}/package-lock.json
Expand All @@ -120,7 +96,7 @@ jobs:
PHP_CLI_SERVER_WORKERS: 3

- name: Cypress run
uses: cypress-io/github-action@v6
uses: cypress-io/github-action@ebe8b24c4428922d0f793a5c4c96853a633180e3 # v6.6.0
with:
record: true
wait-on: '${{ env.CYPRESS_baseUrl }}'
Expand All @@ -135,15 +111,15 @@ jobs:
CYPRESS_ncVersion: ${{ matrix.server-versions }}

- name: Upload test failure screenshots
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
if: failure()
with:
name: Screenshots.${{ matrix.server-versions }}
path: apps/${{ env.APP_NAME }}/cypress/screenshots/
retention-days: 5

- name: Upload nextcloud logs
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
if: failure()
with:
name: ${{ matrix.server-versions }}.log
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/dependabot-approve-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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:
- main
- master
- stable*

permissions:
contents: read

concurrency:
group: dependabot-approve-merge-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
auto-approve-merge:
if: github.actor == 'dependabot[bot]'
runs-on: ubuntu-latest
permissions:
# for hmarr/auto-approve-action to approve PRs
pull-requests: write

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

# Nextcloud bot approve and merge request
- uses: ahmadnassri/action-dependabot-auto-merge@45fc124d949b19b6b8bf6645b6c9d55f4f9ac61a # v2
with:
target: minor
github-token: ${{ secrets.DEPENDABOT_AUTOMERGE_TOKEN }}
8 changes: 4 additions & 4 deletions .github/workflows/lint-eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

name: Lint eslint

on:
pull_request:
on: pull_request

permissions:
contents: read
Expand Down Expand Up @@ -54,7 +53,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
Expand All @@ -64,7 +63,7 @@ jobs:
fallbackNpm: '^9'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

Expand All @@ -74,6 +73,7 @@ jobs:
- name: Install dependencies
env:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_DOWNLOAD: true
run: npm ci

- name: Lint
Expand Down
10 changes: 2 additions & 8 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,7 +21,7 @@ jobs:
name: info.xml lint
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint-php-cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up php
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
- name: Set up php8.1
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
with:
php-version: 8.1
coverage: none
Expand Down
14 changes: 4 additions & 10 deletions .github/workflows/lint-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@

name: Lint php

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

permissions:
contents: read
Expand All @@ -25,16 +19,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-versions: [ "7.3", "7.4", "8.0", "8.1", "8.2" ]
php-versions: [ '7.3', '7.4', '8.0', '8.1', '8.2', '8.3' ]

name: php-lint

steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Set up php ${{ matrix.php-versions }}
uses: shivammathur/setup-php@4bd44f22a98a19e0950cbad5f31095157cc9621b # v2
uses: shivammathur/setup-php@e6f75134d35752277f093989e72e140eaa222f35 # v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@

name: Node

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

permissions:
contents: read
Expand Down Expand Up @@ -53,7 +47,7 @@ jobs:
name: NPM build
steps:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Read package.json node and npm engines version
uses: skjnldsv/read-package-engines-version-actions@8205673bab74a63eb9b8093402fd9e0e018663a1 # v2.2
Expand All @@ -63,7 +57,7 @@ jobs:
fallbackNpm: '^9'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v3
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

Expand All @@ -73,6 +67,7 @@ jobs:
- name: Install dependencies & build
env:
CYPRESS_INSTALL_BINARY: 0
PUPPETEER_SKIP_DOWNLOAD: true
run: |
npm ci
npm run build --if-present
Expand Down
Loading

0 comments on commit d2e5daa

Please sign in to comment.