Skip to content

Commit 260eff5

Browse files
authored
Run tests on all machines (#276)
1 parent 6ea12aa commit 260eff5

File tree

5 files changed

+56
-13
lines changed

5 files changed

+56
-13
lines changed

.github/workflows/build-and-test.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
uses: ./.github/workflows/configs.yml
3434

3535
build-test-nodejs:
36-
needs: [get-configs]
36+
needs: [ get-configs ]
3737
runs-on: ${{ inputs.runs-on }}
3838
steps:
3939
- uses: actions/checkout@v5
@@ -57,12 +57,15 @@ jobs:
5757
- name: Build
5858
run: npm run build
5959

60-
- name: Lint and Test
60+
- name: Code Quality
6161
if: runner.os != 'Windows'
62-
run: npm run lint && npm run test
62+
run: npm run lint && npm run check:duplicates
63+
64+
- name: Test
65+
run: npm run test
6366

6467
build-test-go:
65-
needs: [get-configs]
68+
needs: [ get-configs ]
6669
runs-on: ${{ inputs.runs-on }}
6770
steps:
6871
- name: Checkout repository

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,10 @@ jobs:
99
uses: ./.github/workflows/build-and-test.yml
1010
permissions:
1111
contents: read
12+
strategy:
13+
fail-fast: true
14+
matrix:
15+
os: [ ubuntu-22.04, macos-latest ]
1216
with:
1317
ref: ${{ github.sha }}
18+
runs-on: ${{ matrix.os }}

.github/workflows/pr.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ jobs:
1111

1212
pr-build-test-nodejs:
1313
needs: [ get-configs ]
14-
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: true
16+
matrix:
17+
os: [ ubuntu-22.04, macos-latest ]
18+
runs-on: ${{ matrix.os }}
1519
permissions:
1620
contents: read
1721
pull-requests: write
@@ -31,14 +35,19 @@ jobs:
3135
run: npm run build
3236

3337
- name: Code Quality
38+
if: runner.os != 'Windows'
3439
run: npm run lint && npm run check:duplicates
3540

3641
- name: Test
3742
run: npm run test
3843

3944
pr-build-test-go:
4045
needs: [ get-configs ]
41-
runs-on: ubuntu-latest
46+
strategy:
47+
fail-fast: true
48+
matrix:
49+
os: [ ubuntu-22.04, macos-latest ]
50+
runs-on: ${{ matrix.os }}
4251
steps:
4352
- uses: actions/checkout@v5
4453

package-lock.json

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,10 @@
2323
"clean": "rm -rf build && rm -rf bundle && rm -rf coverage && rm -rf node_modules && rm -rf out && rm -rf jscpd",
2424
"build": "rm -rf out && tsc -b",
2525
"watch": "rm -rf out && tsc -b -w",
26-
"test": "NODE_ENV=test vitest run",
27-
"test:watch": "NODE_ENV=test vitest",
28-
"test:integration": "NODE_ENV=test vitest run --config vitest.integration.config.ts",
29-
"test:unit": "NODE_ENV=test vitest run --config vitest.unit.config.ts",
30-
"test:leaks": "NODE_ENV=test vitest run --pool=forks --logHeapUsage",
26+
"test": "cross-env NODE_ENV=test vitest run",
27+
"test:integration": "cross-env NODE_ENV=test vitest run --config vitest.integration.config.ts",
28+
"test:unit": "cross-env NODE_ENV=test vitest run --config vitest.unit.config.ts",
29+
"test:leaks": "cross-env NODE_ENV=test vitest run --pool=forks --logHeapUsage",
3130
"lint": "eslint --cache --cache-location node_modules/.cache/eslint --max-warnings 0 .",
3231
"lint:fix": "npm run lint -- --fix",
3332
"build:go:dev": "GOPROXY=direct go build -C cfn-init/cmd -v -o ../../bundle/development/bin/cfn-init",
@@ -38,8 +37,8 @@
3837
"bundle:beta": "rm -rf out && webpack --env mode=production --env env=beta",
3938
"bundle:prod": "rm -rf out && webpack --env mode=production --env env=prod",
4039
"download-wheels": "tsx tools/download-wheels.ts",
41-
"benchmark": "NODE_ENV=test AWS_ENV=alpha node --max-old-space-size=16384 --expose-gc -r ts-node/register tools/benchmark.ts",
42-
"generate-metrics": "NODE_ENV=development AWS_ENV=alpha node --max-old-space-size=16384 -r ts-node/register tools/telemetry-generator.ts",
40+
"benchmark": "cross-env NODE_ENV=test AWS_ENV=alpha node --max-old-space-size=16384 --expose-gc -r ts-node/register tools/benchmark.ts",
41+
"generate-metrics": "cross-env NODE_ENV=development AWS_ENV=alpha node --max-old-space-size=16384 -r ts-node/register tools/telemetry-generator.ts",
4342
"debug-tree": "node -r ts-node/register tools/debug_tree.ts",
4443
"generate:guard-rules": "node -r ts-node/register tools/generate-guard-rules.ts",
4544
"check:duplicates": "jscpd",
@@ -109,6 +108,7 @@
109108
"@vitest/eslint-plugin": "1.3.4",
110109
"aws-sdk-client-mock": "4.1.0",
111110
"copy-webpack-plugin": "13.0.1",
111+
"cross-env": "10.1.0",
112112
"eslint": "9.34.0",
113113
"eslint-config-prettier": "10.1.8",
114114
"eslint-plugin-import": "2.32.0",

0 commit comments

Comments
 (0)