Skip to content

Commit 285f69c

Browse files
authored
Merge pull request #86 from highcharts/copilot/add-github-actions-workflow
Add GitHub Actions workflow to run tests on pull requests
2 parents 2e024a6 + 837527c commit 285f69c

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Run Tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- develop
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm install
25+
26+
- name: Check TypeScript compilation is up to date
27+
run: |
28+
npm run tsc
29+
if [ -n "$(git status --porcelain)" ]; then
30+
echo "Error: Files have changed after running 'npm run tsc'. Please run 'npm run tsc' locally and commit the changes."
31+
git status
32+
git diff
33+
exit 1
34+
fi
35+
36+
- name: Setup config.json
37+
run: echo '{"token":"","port":"90","repo":"highcharts/highcharts"}' > config.json
38+
39+
- name: Run tests
40+
run: npm test

0 commit comments

Comments
 (0)