-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (57 loc) · 1.96 KB
/
test.yaml
File metadata and controls
66 lines (57 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# GitHub Actions workflow for testing your Envio indexer
#
# This workflow runs your indexer tests on every push to main and on pull requests.
# It ensures your indexer code compiles correctly and all tests pass before merging.
#
# Prerequisites:
# - Your project uses pnpm as the package manager
# - Vitest is installed (included by default in envio projects)
# - You have a "test" script defined in package.json (e.g., "test": "vitest run")
#
# Required: ENVIO_API_TOKEN
# Envio indexers use HyperSync as the default data source, which requires an API token.
# Add ENVIO_API_TOKEN to your repository secrets before running this workflow.
# To add the secret: Repository Settings > Secrets and variables > Actions > New repository secret
# Get your token at: https://envio.dev
name: Test
on:
# Run tests when code is pushed to main branch
push:
branches:
- main
# Run tests on all pull requests
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
# Check out your repository code
- name: Checkout code
uses: actions/checkout@v4
# Set up pnpm package manager
# Update the version below if you need a different pnpm version
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
# Set up Node.js with caching for faster installs
# The cache: 'pnpm' option caches dependencies between runs
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: 'pnpm'
# Install project dependencies
- name: Install dependencies
run: pnpm install
# Generate indexer types
# This step is required before running tests
- name: Run codegen
run: pnpm codegen
env:
ENVIO_API_TOKEN: ${{ secrets.ENVIO_API_TOKEN }}
# Run your indexer tests using Vitest
- name: Run tests
run: pnpm test
env:
ENVIO_API_TOKEN: ${{ secrets.ENVIO_API_TOKEN }}