From b60f58646195b2c44dfb371ae0e3029c2ff65c57 Mon Sep 17 00:00:00 2001 From: vigneshshanmugam Date: Tue, 14 Jun 2022 11:27:02 -0700 Subject: [PATCH] fix: setup github workflow template correctly --- templates/.github/workflows/run-synthetics.yml | 16 +++++++--------- templates/README.md | 6 +++--- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/templates/.github/workflows/run-synthetics.yml b/templates/.github/workflows/run-synthetics.yml index c3f849b7..c6e34ae8 100644 --- a/templates/.github/workflows/run-synthetics.yml +++ b/templates/.github/workflows/run-synthetics.yml @@ -1,21 +1,19 @@ -name: Synthetics Run +name: Elastic Synthetics Tests on: push: - branches: [main] + branches: [main, master] pull_request: + branches: [main, master] schedule: - cron: '* 0 * * *' jobs: - todos_tests: + test: runs-on: ubuntu-latest - defaults: - run: - working-directory: 'todos/synthetics-tests' steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: '12.22.3' + node-version: 16 - run: npm install - run: "SYNTHETICS_JUNIT_FILE='junit-synthetics.xml' npx @elastic/synthetics . --reporter=junit" continue-on-error: true @@ -24,5 +22,5 @@ jobs: if: always() with: files: '**/junit-*.xml' - fail_on: "test failures" - check_name: Todos Unit Tests \ No newline at end of file + fail_on: 'test failures' + check_name: Elastic Synthetics Tests diff --git a/templates/README.md b/templates/README.md index b545ad5c..59ced7f6 100644 --- a/templates/README.md +++ b/templates/README.md @@ -4,7 +4,7 @@ Browse the directory structure here to see an example skeleton of an [Elastic Sy Make sure to [read the docs](https://www.elastic.co/guide/en/observability/current/monitor-uptime-synthetics.html) as well if you're unfamiliar with Elastic Synthetics. This directory was created with the command `npx @elastic/synthetics `, with `` being the name of the directory you'd like it to make. -You can always use this command to create new projects. +You can always use this command to scafold new Synthetics projects. Key places to look: @@ -12,10 +12,10 @@ Key places to look: - The `journeys` directory contains both basic and more advanced examples of using synthetics. It tests a publicly hosted [Todos List](https://elastic.github.io/synthetics-demo/). - The `.github` directory contains an example github action, demonstrating the use of a CI service for automatically running tests on merges and PR creation. -To run the tests here simply use the following command: +To run the tests locally, use the following command: ```bash -npx @elastic/synthetics . +npm run test ``` Curious to learn more? [Read the docs](https://www.elastic.co/guide/en/observability/current/monitor-uptime-synthetics.html) to learn about pushing configurations to an Elastic cloud stack and more.