Skip to content

Commit 314858c

Browse files
Add CI workflow to check Typescript packaging
On every push and pull request that affects relevant files, check the project's Typescript packaging.
1 parent e64bccf commit 314858c

File tree

4 files changed

+70
-0
lines changed

4 files changed

+70
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Check Packaging
2+
3+
env:
4+
# See: https://github.com/actions/setup-node/#readme
5+
NODE_VERSION: 16.x
6+
7+
on:
8+
push:
9+
paths:
10+
- ".github/workflows/check-packaging-ncc-typescript-npm.ya?ml"
11+
- "lerna.json"
12+
- "package.json"
13+
- "package-lock.json"
14+
- "Taskfile.ya?ml"
15+
- "tsconfig.json"
16+
- "**.[jt]sx?"
17+
pull_request:
18+
paths:
19+
- ".github/workflows/check-packaging-ncc-typescript-npm.ya?ml"
20+
- "lerna.json"
21+
- "package.json"
22+
- "package-lock.json"
23+
- "Taskfile.ya?ml"
24+
- "tsconfig.json"
25+
- "**.[jt]sx?"
26+
workflow_dispatch:
27+
repository_dispatch:
28+
29+
jobs:
30+
check-packaging:
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: Checkout repository
35+
uses: actions/checkout@v3
36+
37+
- name: Setup Node.js
38+
uses: actions/setup-node@v3
39+
with:
40+
node-version: ${{ env.NODE_VERSION }}
41+
42+
- name: Install dependencies
43+
run: npm install
44+
45+
- name: Build project
46+
run: |
47+
npm run build
48+
49+
- name: Check packaging
50+
# Ignoring CR because ncc's output has a mixture of line endings, while the repository should only contain
51+
# Unix-style EOL.
52+
run: git diff --ignore-cr-at-eol --color --exit-code lib

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
[![Check npm status](https://github.com/arduino/setup-protoc/actions/workflows/check-npm-task.yml/badge.svg)](https://github.com/arduino/setup-protoc/actions/workflows/check-npm-task.yml)
1111
[![Check TypeScript status](https://github.com/arduino/setup-protoc/actions/workflows/check-typescript-task.yml/badge.svg)](https://github.com/arduino/setup-protoc/actions/workflows/check-typescript-task.yml)
1212
[![Check tsconfig status](https://github.com/arduino/setup-protoc/actions/workflows/check-tsconfig-task.yml/badge.svg)](https://github.com/arduino/setup-protoc/actions/workflows/check-tsconfig-task.yml)
13+
[![Check Packaging status](https://github.com/arduino/setup-protoc/actions/workflows/check-packaging-ncc-typescript-npm.yml/badge.svg)](https://github.com/arduino/setup-protoc/actions/workflows/check-packaging-ncc-typescript-npm.yml)
1314

1415
This action makes the `protoc` compiler available to Workflows.
1516

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"@types/semver": "^6.0.0",
3636
"@typescript-eslint/eslint-plugin": "^5.46.1",
3737
"@typescript-eslint/parser": "^5.46.1",
38+
"@vercel/ncc": "^0.36.1",
3839
"ajv-cli": "^5.0.0",
3940
"ajv-formats": "^2.1.1",
4041
"eslint": "^8.29.0",

0 commit comments

Comments
 (0)