Skip to content
This repository was archived by the owner on Apr 19, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 0 additions & 35 deletions .github/workflows/npm-test.yml

This file was deleted.

66 changes: 66 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
name: tests

on:
pull_request:
branches: [master]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
name: Run Tests
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v2

- uses: actions/setup-node@v2
with:
node-version: "12.x"
cache: "npm"
- name: Install dependencies
run: npm install

- name: Run Tests
if: github.event_name != 'pull_request'
continue-on-error: true
id: run-tests
run: npm test -- --coverage --watchAll=false > /tmp/coverage_report

- name: Post Test Coverage Report in PR
uses: ArtiomTr/jest-coverage-report-action@v2
continue-on-error: true
if: github.event_name == 'pull_request'
with:
test-script: npm run test
annotations: all

- name: Gain access to test-reports bucket
if: (steps.run-tests.outcome == 'failure' || steps.run-tests.outcome == 'success') && github.ref == 'refs/heads/develop'
uses: google-github-actions/setup-gcloud@master
with:
project_id: "netdata-cloud-testing"
service_account_key: ${{ secrets.TEST_AUTOMATION_SERVICE_ACCOUNT }}
export_default_credentials: true

- name: Upload report to test-reports bucket
if: (steps.run-tests.outcome == 'failure' || steps.run-tests.outcome == 'success') && github.ref == 'refs/heads/develop'
run: |
gsutil -h "Cache-Control: max-age=0, no-store" cp \
/tmp/coverage_report gs://${{ secrets.TEST_AUTOMATION_STORAGE_BUCKET }}/${{ github.event.repository.name }}/coverage_report
gsutil acl set project-private gs://${{ secrets.TEST_AUTOMATION_STORAGE_BUCKET }}/${{ github.event.repository.name }}/coverage_report

- name: Publish test coverage report
if: (steps.run-tests.outcome == 'failure' || steps.run-tests.outcome == 'success') && github.ref == 'refs/heads/develop'
uses: aurelien-baudet/workflow-dispatch@v2
with:
repo: netdata/cloud-workflows
ref: refs/heads/main
workflow: test_coverage_publisher.yml
token: ${{ secrets.TEST_AUTOMATION_TOKEN }}
inputs: '{ "service-name": "${{ github.event.repository.name }}"}'
16 changes: 3 additions & 13 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
"inlineSources": true,
"sourceRoot": "/",
"noImplicitAny": false,
"lib": [
"esnext",
"dom",
"dom.iterable"
],
"lib": ["esnext", "dom", "dom.iterable"],
"module": "esnext",
"target": "es2018",
"jsx": "react",
Expand All @@ -28,12 +24,6 @@
"noEmit": true,
"declaration": true
},
"include": [
"./src/**/*"
],
"exclude": [
"/node_modules/",
"**/*.test.ts",
"**/*.test.tsx"
]
"include": ["./src/**/*"],
"exclude": ["/node_modules/", "**/*.test.ts", "**/*.test.tsx"]
}