-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.49 KB
/
integration-tests.yml
File metadata and controls
53 lines (44 loc) · 1.49 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
name: Integration Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
integration-tests:
runs-on: ubuntu-latest
needs: [] # Run in parallel with other workflows
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Check for API key
id: check-api-key
env:
NUTRIENT_API_KEY: ${{ secrets.NUTRIENT_API_KEY }}
run: |
if [ -n "$NUTRIENT_API_KEY" ] && [ "$NUTRIENT_API_KEY" != "fake_key" ] && [ ${#NUTRIENT_API_KEY} -gt 10 ]; then
echo "has_api_key=true" >> $GITHUB_OUTPUT
echo "✅ Valid API key detected"
else
echo "has_api_key=false" >> $GITHUB_OUTPUT
echo "⏭️ No valid API key - Integration tests will be skipped"
fi
- name: Run integration tests
if: steps.check-api-key.outputs.has_api_key == 'true'
env:
NUTRIENT_API_KEY: ${{ secrets.NUTRIENT_API_KEY }}
run: npm run test:integration
- name: Skip integration tests (no API key)
if: steps.check-api-key.outputs.has_api_key == 'false'
run: |
echo "✅ Integration tests skipped - no valid API key available"
echo "This is expected for forks and external PRs"