Skip to content

Commit 306a1be

Browse files
authored
Merge pull request #997 from nextcloud-libraries/ci/ts
chore: add typescript check script and CI workflow
2 parents b441e5d + 9791167 commit 306a1be

3 files changed

Lines changed: 64 additions & 4 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# This workflow is provided via the organization template repository
2+
#
3+
# https://github.com/nextcloud-libraries/.github
4+
# https://docs.github.com/en/actions/learn-github-actions/sharing-workflows-with-your-organization
5+
#
6+
# SPDX-FileCopyrightText: 2023-2024 Nextcloud GmbH and Nextcloud contributors
7+
# SPDX-License-Identifier: MIT
8+
9+
name: Type checking
10+
11+
on:
12+
pull_request:
13+
push:
14+
branches:
15+
- main
16+
- master
17+
- stable*
18+
19+
permissions:
20+
contents: read
21+
22+
concurrency:
23+
group: lint-typescript-${{ github.head_ref || github.run_id }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
test:
28+
runs-on: ubuntu-latest
29+
name: Lint Typescript
30+
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
34+
with:
35+
persist-credentials: false
36+
37+
- name: Read package.json
38+
uses: nextcloud-libraries/parse-package-engines-action@122ae05d4257008180a514e1ddeb0c1b9d094bdd # v0.1.0
39+
id: versions
40+
41+
- name: Set up node
42+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0
43+
with:
44+
node-version: ${{ steps.versions.outputs.node-version }}
45+
46+
- name: Set up npm
47+
run: npm i -g 'npm@${{ steps.versions.outputs.package-manager-version }}'
48+
49+
- name: Install dependencies
50+
env:
51+
CYPRESS_INSTALL_BINARY: 0
52+
run: npm ci
53+
54+
- name: Check types
55+
run: |
56+
npm run --if-present check-types
57+
npm run --if-present ts:check

package-lock.json

Lines changed: 4 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@
4747
"test:coverage": "LANG=en-US TZ=America/Chicago vitest run --coverage",
4848
"test:dom": "LANG=en-US TZ=America/Chicago vitest run",
4949
"test:node": "LANG=en-US TZ=America/Chicago vitest run --environment node",
50-
"test:watch": "LANG=en-US TZ=America/Chicago vitest watch"
50+
"test:watch": "LANG=en-US TZ=America/Chicago vitest watch",
51+
"ts:check": "tsc --noEmit"
5152
},
5253
"browserslist": [
5354
"extends @nextcloud/browserslist-config"
@@ -74,6 +75,7 @@
7475
"msw": "^2.12.4",
7576
"typedoc": "^0.28.15",
7677
"typedoc-plugin-missing-exports": "^4.1.2",
78+
"typescript": "^5.9.3",
7779
"vite": "^7.3.0",
7880
"vitest": "^4.0.10"
7981
},

0 commit comments

Comments
 (0)