From 1f3c041fc956f6013cff8f94e130403a341b5d3c Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Mon, 16 Sep 2024 11:05:29 -0700 Subject: [PATCH] Refactor CI workflows: remove old test-app workflow and add unified test workflow for App, Home, and Worker --- .github/workflows/test-app.yaml | 20 ---------------- .github/workflows/test.yaml | 42 +++++++++++++++++++++++++++++++++ Worker/package.json | 2 +- 3 files changed, 43 insertions(+), 21 deletions(-) delete mode 100644 .github/workflows/test-app.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/test-app.yaml b/.github/workflows/test-app.yaml deleted file mode 100644 index 45ed1c0ff4..0000000000 --- a/.github/workflows/test-app.yaml +++ /dev/null @@ -1,20 +0,0 @@ -name: App Test - -on: - pull_request: - push: - branches-ignore: - - 'hotfix-*' # excludes hotfix branches - - 'release' - -jobs: - test: - runs-on: ubuntu-latest - env: - CI_PIPELINE_ID: ${{github.run_number}} - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 - with: - node-version: 18.3.0 - - run: cd App && npm install && npm run test \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000000..291583d6ee --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,42 @@ +name: Tests + +on: + pull_request: + push: + branches-ignore: + - 'hotfix-*' # excludes hotfix branches + - 'release' + +jobs: + test-app: + runs-on: ubuntu-latest + env: + CI_PIPELINE_ID: ${{github.run_number}} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 18.3.0 + - run: cd App && npm install && npm run test + + test-home: + runs-on: ubuntu-latest + env: + CI_PIPELINE_ID: ${{github.run_number}} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 18.3.0 + - run: cd Home && npm install && npm run test + + test-worker: + runs-on: ubuntu-latest + env: + CI_PIPELINE_ID: ${{github.run_number}} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v2 + with: + node-version: 18.3.0 + - run: cd Worker && npm install && npm run test \ No newline at end of file diff --git a/Worker/package.json b/Worker/package.json index cea399608f..7dcc69636c 100644 --- a/Worker/package.json +++ b/Worker/package.json @@ -10,7 +10,7 @@ "dev": "npx nodemon", "audit": "npm audit --audit-level=low", "dep-check": "npm install -g depcheck && depcheck ./ --skip-missing=true", - "test": "rm -rf build && jest --detectOpenHandles", + "test": "rm -rf build && jest --detectOpenHandles --passWithNoTests", "coverage": "jest --detectOpenHandles --coverage" }, "author": "OneUptime (https://oneuptime.com/)",