Skip to content
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
92 changes: 92 additions & 0 deletions .github/workflows/lint-typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
# SPDX-License-Identifier: MIT

name: Type checking

on:
workflow_call:

permissions:
contents: read

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

jobs:
changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
src: ${{ steps.changes.outputs.src }}
steps:
- name: Detect TypeScript changes
id: changes
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
continue-on-error: true
with:
filters: |
src:
- '.github/workflows/**'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '**.ts'
- '**.vue'

test:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.src != 'false'
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Read package.json engines
id: versions
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
with:
fallbackNode: '^24'
fallbackNpm: '^11.3'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

- name: Show npm version
run: npm --version

- name: Install dependencies
env:
CYPRESS_INSTALL_BINARY: 0
run: npm ci

- name: Check types
run: |
npm run --if-present check-types
npm run --if-present ts:check

summary:
permissions:
contents: none
runs-on: ubuntu-latest
needs:
- changes
- test
if: always()
name: typescript-summary
steps:
- name: Summary status
env:
CHANGED: ${{ needs.changes.outputs.src }}
TEST_RESULT: ${{ needs.test.result }}
run: |
if [ "$CHANGED" != "false" ] && [ "$TEST_RESULT" != "success" ]; then
exit 1
fi
105 changes: 105 additions & 0 deletions .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
# SPDX-License-Identifier: MIT

name: Node tests

on:
workflow_call:

permissions:
contents: read

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

jobs:
changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
src: ${{ steps.changes.outputs.src }}
steps:
- name: Detect Node test changes
id: changes
uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
continue-on-error: true
with:
filters: |
src:
- '.github/workflows/**'
- '__tests__/**'
- '__mocks__/**'
- 'src/**'
- 'appinfo/info.xml'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- '**.js'
- '**.ts'
- '**.vue'

test:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.src != 'false'
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Read package.json engines
id: versions
uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
with:
fallbackNode: '^24'
fallbackNpm: '^11.3'

- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}

- name: Show npm version
run: npm --version

- name: Install dependencies and build
env:
CYPRESS_INSTALL_BINARY: 0
run: |
npm ci
npm run build --if-present

- name: Test
run: npm run test --if-present

- name: Test and process coverage
run: npm run test:coverage --if-present

- name: Collect coverage
uses: codecov/codecov-action@0b35c9ecc4f0529d0eb674914510c22f85b196b4 # v7.1.0
with:
files: ./coverage/lcov.info

summary:
permissions:
contents: none
runs-on: ubuntu-latest
needs:
- changes
- test
if: always()
name: test-summary
steps:
- name: Summary status
env:
CHANGED: ${{ needs.changes.outputs.src }}
TEST_RESULT: ${{ needs.test.result }}
run: |
if [ "$CHANGED" != "false" ] && [ "$TEST_RESULT" != "success" ]; then
exit 1
fi
195 changes: 195 additions & 0 deletions patches/nextcloud/lint-typescript.yml.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,195 @@
--- upstream/vendor/nextcloud/lint-typescript.yml
+++ .github/workflows/lint-typescript.yml
@@ -1,100 +1,92 @@
-# 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
-#
-# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
-# SPDX-License-Identifier: MIT
-
-name: Type checking
-
-on:
- pull_request:
- push:
- branches:
- - main
- - master
- - stable*
-
-permissions:
- contents: read
-
-concurrency:
- group: lint-typescript-${{ github.head_ref || github.run_id }}
- cancel-in-progress: true
-
-jobs:
- changes:
- runs-on: ubuntu-latest-low
- permissions:
- contents: read
- pull-requests: read
-
- outputs:
- src: ${{ steps.changes.outputs.src}}
-
- steps:
- - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
- id: changes
- continue-on-error: true
- with:
- filters: |
- src:
- - '.github/workflows/lint-typescript.yml'
- - 'package.json'
- - 'package-lock.json'
- - 'tsconfig.json'
- - '**.ts'
- - '**.vue'
-
- test:
- runs-on: ubuntu-latest
-
- needs: changes
- if: needs.changes.outputs.src != 'false'
-
- steps:
- - name: Checkout
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- with:
- persist-credentials: false
-
- - name: Read package.json node and npm engines version
- uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
- id: versions
- with:
- fallbackNode: '^24'
- fallbackNpm: '^11.3'
-
- - name: Set up node ${{ steps.versions.outputs.nodeVersion }}
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.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: Install dependencies
- env:
- CYPRESS_INSTALL_BINARY: 0
- run: |
- npm ci
-
- - name: Check types
- run: |
- npm run --if-present check-types
- npm run --if-present ts:check
-
- summary:
- permissions:
- contents: none
- runs-on: ubuntu-latest-low
- needs: [changes, test]
-
- if: always()
-
- name: typescript-summary
-
- steps:
- - name: Summary status
- run: if ${{ needs.changes.outputs.src != 'false' && needs.test.result != 'success' }}; then exit 1; fi
+# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
+# SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
+# SPDX-License-Identifier: MIT
+
+name: Type checking
+
+on:
+ workflow_call:
+
+permissions:
+ contents: read
+
+concurrency:
+ group: lint-typescript-${{ github.head_ref || github.run_id }}
+ cancel-in-progress: true
+
+jobs:
+ changes:
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ pull-requests: read
+ outputs:
+ src: ${{ steps.changes.outputs.src }}
+ steps:
+ - name: Detect TypeScript changes
+ id: changes
+ uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4.0.3
+ continue-on-error: true
+ with:
+ filters: |
+ src:
+ - '.github/workflows/**'
+ - 'package.json'
+ - 'package-lock.json'
+ - 'tsconfig.json'
+ - '**.ts'
+ - '**.vue'
+
+ test:
+ runs-on: ubuntu-latest
+ needs: changes
+ if: needs.changes.outputs.src != 'false'
+ steps:
+ - name: Checkout
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+
+ - name: Read package.json engines
+ id: versions
+ uses: skjnldsv/read-package-engines-version-actions@06d6baf7d8f41934ab630e97d9e6c0bc9c9ac5e4 # v3
+ with:
+ fallbackNode: '^24'
+ fallbackNpm: '^11.3'
+
+ - name: Set up node ${{ steps.versions.outputs.nodeVersion }}
+ uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
+ with:
+ node-version: ${{ steps.versions.outputs.nodeVersion }}
+
+ - name: Show npm version
+ run: npm --version
+
+ - name: Install dependencies
+ env:
+ CYPRESS_INSTALL_BINARY: 0
+ run: npm ci
+
+ - name: Check types
+ run: |
+ npm run --if-present check-types
+ npm run --if-present ts:check
+
+ summary:
+ permissions:
+ contents: none
+ runs-on: ubuntu-latest
+ needs:
+ - changes
+ - test
+ if: always()
+ name: typescript-summary
+ steps:
+ - name: Summary status
+ env:
+ CHANGED: ${{ needs.changes.outputs.src }}
+ TEST_RESULT: ${{ needs.test.result }}
+ run: |
+ if [ "$CHANGED" != "false" ] && [ "$TEST_RESULT" != "success" ]; then
+ exit 1
+ fi
Loading
Loading