Setup test, break apart entrypoint, & align GHA workflow

This commit is contained in:
Reginald Bondoc
2022-12-20 00:56:53 +01:00
parent 33dddd440c
commit fc906e7dc7
15 changed files with 748 additions and 303 deletions

View File

@@ -1,41 +1,42 @@
name: Check Backend Pull Request
name: 'Check Backend Pull Request'
on:
pull_request:
types: [ opened, synchronize ]
types: [opened, synchronize]
paths:
- 'backend/**'
- '!backend/README.md'
- '!backend/.*'
- 'backend/.eslintrc.js'
jobs:
check-be-pr:
name: Check
runs-on: ubuntu-latest
steps:
-
name: ☁️ Checkout source
- name: ☁️ Checkout source
uses: actions/checkout@v3
-
name: 🔧 Setup Node 16
- name: 🔧 Setup Node 16
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'
cache-dependency-path: backend/package-lock.json
-
name: 📦 Install dependencies
- name: 📦 Install dependencies
run: npm ci --only-production --ignore-scripts
working-directory: backend
# -
# name: 🧪 Run tests
# run: npm run test:ci
# working-directory: backend
-
name: 🏗️ Run build
- name: 🧪 Run tests
run: npm run test:ci
working-directory: backend
- name: 📁 Upload test results
uses: actions/upload-artifact@v3
if: always()
with:
name: be-test-results
path: |
backend/reports
backend/coverage
- name: 🏗️ Run build
run: npm run build
working-directory: backend