Skip to content

Commit 233e287

Browse files
authored
Merge pull request #1439 from nextcloud-libraries/ci/tscheck
ci: add workflow to check for Typescript issues
2 parents f596764 + 9ef2014 commit 233e287

2 files changed

Lines changed: 58 additions & 0 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.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
"test": "vitest run",
4141
"test:coverage": "vitest run --coverage",
4242
"test:watch": "vitest watch",
43+
"ts:check": "tsc --noEmit",
4344
"watch": "vite --mode development build --watch"
4445
},
4546
"overrides": {

0 commit comments

Comments
 (0)