Note: We don't recommend using the @master version unless you're happy to test the latest changes.
# example 1: on push to master
name: Node Test Runner
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu:latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: '0'
- name: Run tests 🧪
uses: gha-actions/test-runner@0.0.2 # Don't use @master or @v1 unless you're happy to test the latest version
env:
LANGUAGE: 'node'# example 2: on merge to master from pull request (recommended)
name: Node Test Runner
on:
pull_request:
types:
- closed
branches:
- master
jobs:
build:
if: github.event.pull_request.merged == true
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'
- name: Run tests 🧪
uses: gha-actions/test-runner@0.0.2 # Don't use @master or @v1 unless you're happy to test the latest version
env:
LANGUAGE: 'node'
Environment Variables
- LANGUAGE (required) - Required for test run: The language should be one of the following options:
Python,Node.js, orJavaScript.