fix: format #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run tests | |
on: | |
push: | |
permissions: | |
contents: read | |
jobs: | |
tests: | |
name: Run tests | |
# https://docs.github.com/en/actions/using-containerized-services/creating-redis-service-containers#running-jobs-in-containers | |
# Containers must run in Linux based operating systems | |
runs-on: ubuntu-22.04 | |
# Docker Hub image that `container-job` executes in | |
container: node:20-alpine | |
# Service containers to run with `container-job` | |
services: | |
# Label used to access the service container | |
redis: | |
# Docker Hub image | |
image: redis | |
# Set health checks to wait until redis has started | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
# Downloads a copy of the code in your repository before running CI tests | |
- name: Check out repository code | |
uses: actions/checkout@v4 | |
# Performs a clean installation of all dependencies in the `package.json` file | |
# For more information, see https://docs.npmjs.com/cli/ci.html | |
- name: Install dependencies | |
run: npm ci | |
- name: Copy config | |
run: cp config/default.example.yml config/default.yml | |
- name: Run tests | |
# Runs a script that creates a Redis client, populates | |
# the client with data, and retrieves data | |
run: npm run test | |
# Environment variable used by the `client.js` script to create a new Redis client. | |
env: | |
# The hostname used to communicate with the Redis service container | |
REDIS_HOST: redis | |
# The default Redis port | |
REDIS_PORT: 6379 | |
XAPI_ENABLED: true |