Skip to content

Commit

Permalink
fix: setup github workflow template correctly (#529)
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshshanmugam authored Jun 14, 2022
1 parent b443c25 commit c94b2ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
16 changes: 7 additions & 9 deletions templates/.github/workflows/run-synthetics.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -24,5 +22,5 @@ jobs:
if: always()
with:
files: '**/junit-*.xml'
fail_on: "test failures"
check_name: Todos Unit Tests
fail_on: 'test failures'
check_name: Elastic Synthetics Tests
6 changes: 3 additions & 3 deletions templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ 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 <target-directory>`, with `<target-directory>` 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:

- The `synthetics.config.ts` file contains configuration for your project.
- 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.

0 comments on commit c94b2ad

Please sign in to comment.