Skip to content

Commit 2adc1e8

Browse files
Copilotseesharprun
andauthored
Add TypeScript validation workflow (#16)
The existing `validate-javascript` job covered JS samples only; TypeScript samples in a `typescript/` directory had no CI validation. ## Changes - **`validate-structure`**: added `typescript` to the scanned directories for naming convention and `README.md` checks - **`validate-typescript`** (new job): mirrors `validate-javascript` with an additional `npm run build` step to handle TypeScript compilation ```yaml validate-typescript: name: Validate TypeScript Samples steps: - uses: actions/setup-node@v6 with: node-version: '20' - name: Install and build run: | [ -d typescript ] || exit 0 for sample in typescript/*/; do [ -f "${sample}package.json" ] || continue npm install --prefix "$sample" --silent npm run build --prefix "$sample" --if-present done ``` Both jobs exit cleanly when the `typescript/` directory does not yet exist. <!-- START COPILOT CODING AGENT TIPS --> --- 💬 Send tasks to Copilot coding agent from [Slack](https://gh.io/cca-slack-docs) and [Teams](https://gh.io/cca-teams-docs) to turn conversations into code. Copilot posts an update in your thread when it's finished. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: seesharprun <5067401+seesharprun@users.noreply.github.com> Co-authored-by: Sidney Andrews <sidandrews@microsoft.com>
1 parent 590af87 commit 2adc1e8

1 file changed

Lines changed: 20 additions & 1 deletion

File tree

.github/workflows/validate.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: actions/checkout@v6
2323
- name: Validate naming and README presence
2424
run: |
25-
for dir in python javascript java dotnet go; do
25+
for dir in python javascript typescript java dotnet go; do
2626
[ -d "$dir" ] || continue
2727
for sample in "$dir"/*/; do
2828
name=$(basename "$sample")
@@ -79,6 +79,25 @@ jobs:
7979
npm test --prefix "$sample" --if-present
8080
done
8181
82+
validate-typescript:
83+
name: Validate TypeScript Samples
84+
runs-on: ubuntu-latest
85+
steps:
86+
- name: Checkout repository
87+
uses: actions/checkout@v6
88+
- name: Set up Node.js
89+
uses: actions/setup-node@v6
90+
with:
91+
node-version: '20'
92+
- name: Install and build
93+
run: |
94+
[ -d typescript ] || exit 0
95+
for sample in typescript/*/; do
96+
[ -f "${sample}package.json" ] || continue
97+
npm install --prefix "$sample" --silent
98+
npm run build --prefix "$sample" --if-present
99+
done
100+
82101
validate-java:
83102
name: Validate Java Samples
84103
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)