Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: setup github workflow template correctly #529

Merged
merged 1 commit into from
Jun 14, 2022
Merged
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
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.