ci: Implement test checks for PRs and image publishing

This commit is contained in:
FoxxMD 2024-02-08 13:07:13 -05:00
parent 0efbe41b7e
commit f231d4e1e4
3 changed files with 48 additions and 3 deletions

View file

@ -12,9 +12,28 @@ on:
- '**.md'
jobs:
push_to_registry:
name: Push Docker image to Docker Hub
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'
- name: Install dev dependencies
run: npm ci
- name: Build Backend
run: 'npm run build:backend'
- name: Test Backend
run: npm run test
push_to_registry:
name: Build and push container images
runs-on: ubuntu-latest
needs: test
strategy:
fail-fast: false
matrix:

24
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,24 @@
name: Publish Docker image to Dockerhub
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
test:
name: Run Tests
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
cache: 'npm'
- name: Install dev dependencies
run: npm ci
- name: Build Backend
run: 'npm run build:backend'
- name: Test Backend
run: npm run test