mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-16 04:11:29 +00:00
111 lines
3.4 KiB
YAML
111 lines
3.4 KiB
YAML
name: Tests
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
unit-test:
|
|
name: Unit Tests
|
|
timeout-minutes: 60
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
cache-dependency-path: './package-lock.json'
|
|
- name: Install dependencies
|
|
run: npm ci --legacy-peer-deps
|
|
|
|
# build libraries
|
|
- name: Build libraries
|
|
run: |
|
|
npm run build --workspace=packages/bruno-common
|
|
npm run build --workspace=packages/bruno-query
|
|
npm run sandbox:bundle-libraries --workspace=packages/bruno-js
|
|
npm run build --workspace=packages/bruno-converters
|
|
npm run build --workspace=packages/bruno-requests
|
|
|
|
- name: Lint Check
|
|
run: npm run lint
|
|
|
|
# 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
|
|
|
|
- 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
|
|
- name: Test Package bruno-common
|
|
run: npm run test --workspace=packages/bruno-common
|
|
- name: Test Package bruno-converters
|
|
run: npm run test --workspace=packages/bruno-converters
|
|
- name: Test Package bruno-electron
|
|
run: npm run test --workspace=packages/bruno-electron
|
|
|
|
cli-test:
|
|
name: CLI Tests
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
checks: write
|
|
pull-requests: write
|
|
contents: read
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: 'npm'
|
|
cache-dependency-path: './package-lock.json'
|
|
|
|
- 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
|
|
npm run sandbox:bundle-libraries --workspace=packages/bruno-js
|
|
npm run build --workspace=packages/bruno-converters
|
|
npm run build --workspace=packages/bruno-requests
|
|
|
|
- name: Start Testbench Server
|
|
run: |
|
|
cd packages/bruno-tests
|
|
npm run dev 1>/tmp/tesbench-server-logs.txt 2>&1 &
|
|
|
|
- name: Run tests
|
|
run: |
|
|
cd packages/bruno-tests/collection
|
|
npm install
|
|
node ../../bruno-cli/bin/bru.js run \
|
|
--env Prod \
|
|
--cacert ../ssl/localhost.crt \
|
|
--output junit.xml --format junit
|
|
|
|
- uses: actions/upload-artifact@v4
|
|
if: ${{ !cancelled() }}
|
|
with:
|
|
name: tesbench-server-logs
|
|
path: /tmp/tesbench-server-logs.txt
|
|
retention-days: 7
|
|
|
|
- name: Publish Test Report
|
|
uses: EnricoMi/publish-unit-test-result-action@v2
|
|
if: always()
|
|
with:
|
|
files: packages/bruno-tests/collection/junit.xml
|
|
comment_mode: always
|