Repository navigation
72 lines (68 loc) 路 1.81 KB
/
Copy pathtests.yml
File metadata and controls
72 lines (68 loc) 路 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Project: https://github.com/Mathieu2301/TradingView-API
# Package: https://www.npmjs.com/package/@mathieuc/tradingview
name: Tests
on:
push:
pull_request:
branches:
- main
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
# Deterministic checks: no network access to TradingView is needed.
Node:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x, 22.x, 24.x]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run typecheck
- run: npm run lint
- run: npm test
if: matrix.node-version != '22.x'
- run: npm run test:coverage
if: matrix.node-version == '22.x'
- uses: actions/upload-artifact@v4
if: matrix.node-version == '22.x'
with:
name: unit-coverage
path: coverage/
- run: npm run build
- run: npm run smoke
Bun:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'
- uses: oven-sh/setup-bun@v2
- run: npm ci
- run: npm run test:bun
- run: npm run build
# The smoke test imports the packed tarball under Node and Bun.
- run: npm run smoke
# Talks to TradingView: nightly or manual only, never blocking.
Live:
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'npm'
- run: npm ci
- run: npm run test:live
env:
SESSION: ${{ secrets.TW_SESSION }}
SIGNATURE: ${{ secrets.TW_SIGNATURE }}