Skip to content

Commit f11140c

Browse files
committed
chore(logger): Test using Github Action matrix strategy to pass env var to e2e tests
1 parent df415e1 commit f11140c

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

Diff for: .github/workflows/run-e2e-tests.yml

+15-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: run-e2e-tests
22
on:
3-
workflow_dispatch: {}
3+
# workflow_dispatch: {}
4+
# TODO: remove this. This is just temporary to test matrix strategy w/ e2e tests
5+
push:
6+
branches:
7+
- chore/run-e2e-multiple-runtimes
8+
49
jobs:
510
run:
611
#########################
@@ -13,16 +18,16 @@ jobs:
1318
permissions:
1419
id-token: write # needed to interact with GitHub's OIDC Token endpoint.
1520
contents: read
21+
strategy:
22+
matrix:
23+
nodeRuntime: ['12', '14']
1624
steps:
1725
- name: "Checkout"
1826
uses: actions/checkout@v2
19-
#########################
20-
# Release new version
21-
#########################
22-
- name: "Use NodeJS 14"
27+
- name: "Setup NodeJS ${{ matrix.nodeRuntime }}"
2328
uses: actions/setup-node@v2
2429
with:
25-
node-version: '14'
30+
node-version: ${{ matrix.nodeRuntime }}
2631
- name: Install packages
2732
run: |
2833
npm ci
@@ -33,7 +38,10 @@ jobs:
3338
role-to-assume: ${{ secrets.AWS_ROLE_ARN_TO_ASSUME }}
3439
aws-region: eu-west-1
3540
- name: Run integration tests
36-
run: npm run lerna-test:e2e
41+
run: |
42+
export RUNTIME=:nodejs${{ matrix.nodeRuntime }}x
43+
echo $RUNTIME
44+
npm run lerna-test:e2e
3745
- name: Test packaging
3846
run: |
3947
npm run lerna-package

Diff for: packages/logger/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test:unit": "jest --group=unit --detectOpenHandles --coverage --verbose",
1616
"test:e2e:nodejs12x": "RUNTIME=nodejs12x jest --group=e2e/logger",
1717
"test:e2e:nodejs14x": "RUNTIME=nodejs14x jest --group=e2e/logger",
18-
"test:e2e": "concurrently \"npm:test:e2e:nodejs12x\" \"npm:test:e2e:nodejs14x\"",
18+
"test:e2e": "jest --group=e2e/logger",
1919
"watch": "jest --watch",
2020
"build": "tsc",
2121
"lint": "eslint --ext .ts --fix --no-error-on-unmatched-pattern src tests",

0 commit comments

Comments
 (0)