Skip to content

Commit

Permalink
test both legacy and new infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrHeinz authored Feb 25, 2025
1 parent b193d84 commit 29dd040
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/end-to-end.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:

strategy:
matrix:
infrastructure: [legacy, cloud]
node-version: [16.x, 18.x, 20.x, 22.x]
dependencies: [install, update]
fail-fast: false
Expand All @@ -34,12 +35,17 @@ jobs:
working-directory: ./example-project

- name: Run example project with valid token
run: node index.js ${{ secrets.SOURCE_TOKEN }} in.logs.betterstack.com
env:
INGESTING_HOST: ${{ matrix.infrastructure == 'cloud' && secrets.CLOUD_INGESTING_HOST || 'in.logs.betterstack.com' }}
SOURCE_TOKEN: ${{ matrix.infrastructure == 'cloud' && secrets.CLOUD_SOURCE_TOKEN || secrets.SOURCE_TOKEN }}
run: node index.js ${{ env.SOURCE_TOKEN }} ${{ env.INGESTING_HOST }}
working-directory: ./example-project

- name: Run example project with invalid token
env:
INGESTING_HOST: ${{ matrix.infrastructure == 'cloud' && secrets.CLOUD_INGESTING_HOST || 'in.logs.betterstack.com' }}
run: |
if node index.js INVALID_TOKEN in.logs.betterstack.com; then
if node index.js INVALID_TOKEN ${{ env.INGESTING_HOST }}; then
echo "This should have failed but didn't"
exit 1
else
Expand Down Expand Up @@ -69,12 +75,17 @@ jobs:
working-directory: ./example-project

- name: Run example project with valid token
run: bun run index.js ${{ secrets.SOURCE_TOKEN }} in.logs.betterstack.com
env:
INGESTING_HOST: ${{ matrix.infrastructure == 'cloud' && secrets.CLOUD_INGESTING_HOST || 'in.logs.betterstack.com' }}
SOURCE_TOKEN: ${{ matrix.infrastructure == 'cloud' && secrets.CLOUD_SOURCE_TOKEN || secrets.SOURCE_TOKEN }}
run: bun run index.js ${{ env.SOURCE_TOKEN }} ${{ env.INGESTING_HOST }}
working-directory: ./example-project

- name: Run example project with invalid token
env:
INGESTING_HOST: ${{ matrix.infrastructure == 'cloud' && secrets.CLOUD_INGESTING_HOST || 'in.logs.betterstack.com' }}
run: |
if bun run index.js INVALID_TOKEN in.logs.betterstack.com; then
if bun run index.js INVALID_TOKEN ${{ env.INGESTING_HOST }}; then
echo "This should have failed but didn't"
exit 1
else
Expand Down

0 comments on commit 29dd040

Please sign in to comment.