@@ -2,8 +2,9 @@ name: E2E Tests
22
33on :
44 push :
5- branches :
6- - master
5+ paths :
6+ - .github/workflows/end-to-end.yml
7+ - example-project/**
78 schedule :
89 - cron : " 20 5 * * *"
910 workflow_dispatch :
1415
1516 strategy :
1617 matrix :
18+ infrastructure : [legacy, cloud]
1719 node-version : [16.x, 18.x, 20.x, 22.x]
1820 dependencies : [install, update]
1921 fail-fast : false
@@ -33,12 +35,17 @@ jobs:
3335 working-directory : ./example-project
3436
3537 - name : Run example project with valid token
36- run : node index.js ${{ secrets.SOURCE_TOKEN }}
38+ env :
39+ INGESTING_HOST : ${{ matrix.infrastructure == 'cloud' && secrets.CLOUD_INGESTING_HOST || 'in.logs.betterstack.com' }}
40+ SOURCE_TOKEN : ${{ matrix.infrastructure == 'cloud' && secrets.CLOUD_SOURCE_TOKEN || secrets.SOURCE_TOKEN }}
41+ run : node index.js ${{ env.SOURCE_TOKEN }} ${{ env.INGESTING_HOST }}
3742 working-directory : ./example-project
3843
3944 - name : Run example project with invalid token
45+ env :
46+ INGESTING_HOST : ${{ matrix.infrastructure == 'cloud' && secrets.CLOUD_INGESTING_HOST || 'in.logs.betterstack.com' }}
4047 run : |
41- if node index.js INVALID_TOKEN; then
48+ if node index.js INVALID_TOKEN ${{ env.INGESTING_HOST }} ; then
4249 echo "This should have failed but didn't"
4350 exit 1
4451 else
5158
5259 strategy :
5360 matrix :
61+ infrastructure : [legacy, cloud]
5462 bun-version : [latest, 1.0.0]
5563 dependencies : [install, update]
5664 fail-fast : false
@@ -68,12 +76,17 @@ jobs:
6876 working-directory : ./example-project
6977
7078 - name : Run example project with valid token
71- run : bun run index.js ${{ secrets.SOURCE_TOKEN }}
79+ env :
80+ INGESTING_HOST : ${{ matrix.infrastructure == 'cloud' && secrets.CLOUD_INGESTING_HOST || 'in.logs.betterstack.com' }}
81+ SOURCE_TOKEN : ${{ matrix.infrastructure == 'cloud' && secrets.CLOUD_SOURCE_TOKEN || secrets.SOURCE_TOKEN }}
82+ run : bun run index.js ${{ env.SOURCE_TOKEN }} ${{ env.INGESTING_HOST }}
7283 working-directory : ./example-project
7384
7485 - name : Run example project with invalid token
86+ env :
87+ INGESTING_HOST : ${{ matrix.infrastructure == 'cloud' && secrets.CLOUD_INGESTING_HOST || 'in.logs.betterstack.com' }}
7588 run : |
76- if bun run index.js INVALID_TOKEN; then
89+ if bun run index.js INVALID_TOKEN ${{ env.INGESTING_HOST }} ; then
7790 echo "This should have failed but didn't"
7891 exit 1
7992 else
0 commit comments