Skip to content

Fix asynchronous tests #225

Fix asynchronous tests

Fix asynchronous tests #225

Workflow file for this run

name: 'Tests'
# This workflow is responsible for running the Haztrak react client tests.
on:
pull_request:
branches: [ 'main' ]
push:
branches-ignore: [ 'main' ]
workflow_call:
jobs:
run_unit_tests:
name: 'Unit Tests'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20 ]
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Setup Node'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: 'Install Dependencies'
run: npm ci
- name: 'Test Node.js-${{ matrix.node-version }}'
run: npm test
env:
VITE_MODE: 'TEST'
test_npm_build:
name: 'NPM Build'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 20 ]
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Setup Node'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: 'Install Dependencies'
run: npm ci
- name: 'Build'
run: npm run build
test_image_builds:
name: 'Image Builds'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Docker meta'
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository_owner }}/the-manifest-game
- name: 'Build and push'
uses: docker/build-push-action@v3
with:
platforms: linux/amd64
context: .
push: false
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
lint:
name: 'Lint'
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v4
- name: 'Setup Node'
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: 'Install Dependencies'
run: npm ci
- name: 'Lint Source'
run: npm run lint