Skip to content

Commit 8b16c36

Browse files
authored
Merge pull request #19 from Azure-Samples/copilot/create-build-test-workflow
Add GitHub Actions workflow for packages-v1 build validation without package-lock.json
2 parents fe03c71 + 9c6e41b commit 8b16c36

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Build and Test packages-v1
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'packages-v1/**'
9+
- 'package.json'
10+
- '.github/workflows/build-packages-v1.yml'
11+
pull_request:
12+
branches:
13+
- main
14+
paths:
15+
- 'packages-v1/**'
16+
- 'package.json'
17+
- '.github/workflows/build-packages-v1.yml'
18+
schedule:
19+
- cron: '0 0 * * 0' # Run weekly on Sundays at midnight UTC
20+
workflow_dispatch:
21+
22+
permissions:
23+
contents: read
24+
25+
jobs:
26+
build:
27+
runs-on: ubuntu-latest
28+
strategy:
29+
matrix:
30+
node-version: [22, 24]
31+
fail-fast: false
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
37+
- name: Setup Node.js ${{ matrix.node-version }}
38+
uses: actions/setup-node@v4
39+
with:
40+
node-version: ${{ matrix.node-version }}
41+
42+
- name: Install dependencies
43+
run: npm install
44+
45+
- name: Build packages-v1
46+
run: npm run build
47+
48+
build-summary:
49+
runs-on: ubuntu-latest
50+
needs: build
51+
if: always()
52+
53+
steps:
54+
- name: Check build status
55+
run: |
56+
if [ "${{ needs.build.result }}" != "success" ]; then
57+
echo "Build failed for one or more Node.js versions"
58+
exit 1
59+
fi
60+
echo "All builds passed successfully"

0 commit comments

Comments
 (0)