Skip to main content

GitHub Actions

Example

name: Run Tesmon Tests

on:
push:
branches: # On push to branches.
- main
workflow_dispatch: # Manual trigger.
schedule:
- cron: "0 0 * * *" # Daily at midnight UTC.

env:
TESMON_ENVIRONMENT_ID: 0bbacb50-c6b7-11ee-a064-abe84b340476
TESMON_API_TOKEN: ${{ secrets.TESMON_API_TOKEN }}

jobs:
test:
runs-on: ubuntu-latest
services:
test-run-engine:
image: ghcr.io/tesmon-io/tesmon-test-run-engine:latest
env:
TESMON_ENVIRONMENT_ID: ${{ env.TESMON_ENVIRONMENT_ID }}
TESMON_API_TOKEN: ${{ env.TESMON_API_TOKEN }}
# optional only if using selenium.
selenium:
image: selenium/standalone-chrome:latest
ports:
- 4444:4444

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node
uses: actions/setup-node@v3
- name: Install Tesmon CLI
run: npm install -g @tesmon/cli
shell: bash
- name: Run Tesmon Tests
run: |
tesmon test --environmentId $TESMON_ENVIRONMENT_ID --apiToken $TESMON_API_TOKEN --model default --envConfigId staging -p ./tesmon-tests
shell: bash