2024-01-29 09:18:51 +01:00
|
|
|
name: Tests
|
2023-01-17 15:05:59 +01:00
|
|
|
on:
|
|
|
|
push:
|
2023-09-29 03:39:33 +02:00
|
|
|
branches: [main]
|
2023-01-17 15:05:59 +01:00
|
|
|
pull_request:
|
2023-09-29 03:39:33 +02:00
|
|
|
branches: [main]
|
2024-02-08 20:58:54 +01:00
|
|
|
|
2023-01-17 15:05:59 +01:00
|
|
|
jobs:
|
2024-01-29 09:15:25 +01:00
|
|
|
unit-test:
|
2024-01-29 11:33:18 +01:00
|
|
|
name: Unit Tests
|
2023-01-17 15:05:59 +01:00
|
|
|
timeout-minutes: 60
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-11 12:57:12 +02:00
|
|
|
- uses: actions/checkout@v4
|
2024-04-09 22:21:11 +02:00
|
|
|
- uses: actions/setup-node@v4
|
2023-09-29 03:39:33 +02:00
|
|
|
with:
|
2023-10-11 12:57:12 +02:00
|
|
|
node-version-file: '.nvmrc'
|
2024-08-06 09:11:57 +02:00
|
|
|
cache: 'npm'
|
|
|
|
cache-dependency-path: './package-lock.json'
|
2023-09-29 03:39:33 +02:00
|
|
|
- name: Install dependencies
|
2023-10-11 12:57:12 +02:00
|
|
|
run: npm ci --legacy-peer-deps
|
2024-01-29 13:12:27 +01:00
|
|
|
|
|
|
|
# build libraries
|
|
|
|
- name: Build libraries
|
|
|
|
run: |
|
|
|
|
npm run build --workspace=packages/bruno-common
|
|
|
|
npm run build --workspace=packages/bruno-query
|
2024-08-21 09:22:49 +02:00
|
|
|
npm run sandbox:bundle-libraries --workspace=packages/bruno-js
|
|
|
|
|
|
|
|
# tests
|
|
|
|
- name: Test Package bruno-js
|
|
|
|
run: npm run test --workspace=packages/bruno-js
|
|
|
|
- name: Test Package bruno-cli
|
|
|
|
run: npm run test --workspace=packages/bruno-cli
|
2024-01-29 13:12:27 +01:00
|
|
|
|
2023-09-29 03:39:33 +02:00
|
|
|
- name: Test Package bruno-query
|
|
|
|
run: npm run test --workspace=packages/bruno-query
|
|
|
|
- name: Test Package bruno-lang
|
|
|
|
run: npm run test --workspace=packages/bruno-lang
|
|
|
|
- name: Test Package bruno-schema
|
|
|
|
run: npm run test --workspace=packages/bruno-schema
|
|
|
|
- name: Test Package bruno-app
|
|
|
|
run: npm run test --workspace=packages/bruno-app
|
2024-01-29 09:15:25 +01:00
|
|
|
- name: Test Package bruno-common
|
|
|
|
run: npm run test --workspace=packages/bruno-common
|
2023-09-29 03:39:33 +02:00
|
|
|
- name: Test Package bruno-electron
|
2024-01-29 09:15:25 +01:00
|
|
|
run: npm run test --workspace=packages/bruno-electron
|
|
|
|
|
|
|
|
cli-test:
|
2024-01-29 11:33:18 +01:00
|
|
|
name: CLI Tests
|
2024-01-29 09:15:25 +01:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
2024-04-09 22:21:11 +02:00
|
|
|
- uses: actions/setup-node@v4
|
2024-01-29 09:21:37 +01:00
|
|
|
with:
|
|
|
|
node-version-file: '.nvmrc'
|
2024-08-06 12:35:05 +02:00
|
|
|
cache: 'npm'
|
|
|
|
cache-dependency-path: './package-lock.json'
|
2024-01-29 09:21:37 +01:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: npm ci --legacy-peer-deps
|
|
|
|
|
|
|
|
- name: Build Libraries
|
|
|
|
run: |
|
|
|
|
npm run build --workspace=packages/bruno-query
|
|
|
|
npm run build --workspace=packages/bruno-common
|
2024-08-21 09:22:49 +02:00
|
|
|
npm run sandbox:bundle-libraries --workspace=packages/bruno-js
|
2024-01-29 09:21:37 +01:00
|
|
|
|
|
|
|
- name: Run tests
|
2024-01-29 09:15:25 +01:00
|
|
|
run: |
|
2024-01-29 09:18:51 +01:00
|
|
|
cd packages/bruno-tests/collection
|
2024-01-30 17:56:47 +01:00
|
|
|
npm install
|
2024-01-29 09:18:51 +01:00
|
|
|
node ../../bruno-cli/bin/bru.js run --env Prod --output junit.xml --format junit
|
2024-01-29 09:15:25 +01:00
|
|
|
|
2024-02-08 21:07:19 +01:00
|
|
|
- name: Publish Test Report
|
2024-04-09 22:21:11 +02:00
|
|
|
uses: EnricoMi/publish-unit-test-result-action@v2
|
|
|
|
if: always()
|
2024-02-08 21:07:19 +01:00
|
|
|
with:
|
2024-04-09 22:21:11 +02:00
|
|
|
files: packages/bruno-tests/collection/junit.xml
|
|
|
|
comment_mode: always
|