mirror of
https://github.com/usebruno/bruno.git
synced 2024-12-22 23:02:40 +01:00
cd629451e4
* fix: posthog api key as a process env var * fix: checkov tests workflow warning * revert: updates
84 lines
2.5 KiB
YAML
84 lines
2.5 KiB
YAML
name: Tests
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
unit-test:
|
|
name: Unit Tests
|
|
timeout-minutes: 60
|
|
runs-on: ubuntu-latest
|
|
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
|
|
|
|
# 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-electron
|
|
run: npm run test --workspace=packages/bruno-electron
|
|
|
|
cli-test:
|
|
name: CLI Tests
|
|
runs-on: ubuntu-latest
|
|
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
|
|
|
|
- name: Run tests
|
|
run: |
|
|
cd packages/bruno-tests/collection
|
|
npm install
|
|
node ../../bruno-cli/bin/bru.js run --env Prod --output junit.xml --format junit
|
|
|
|
- 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
|