Skip to content

Commit

Permalink
[CI] Combine action templates with matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
MNThomson committed Jun 14, 2024
1 parent 033741f commit b378bcd
Showing 1 changed file with 7 additions and 44 deletions.
51 changes: 7 additions & 44 deletions .github/workflows/user.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: User
name: Backend

on:
push:
Expand All @@ -8,14 +8,16 @@ on:
env:
NODE_VERSION: "20.x"

defaults:
run:
working-directory: apps/backend/user

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
strategy:
matrix:
service: [user, listing, review, message, lib]
defaults:
run:
working-directory: apps/backend/${{ matrix.service }}
steps:
- uses: actions/checkout@v4

Expand All @@ -28,42 +30,3 @@ jobs:

- name: Lint
run: npm run lint

format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Install dependencies
run: npm ci

- name: Format
run: npm run format:ci

test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Docker Compose Up
run: docker compose up -d user datalayer database

- name: Test
run: docker compose exec user npm run test:ci

security:
name: Security
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Nodejs Scan
uses: ajinabraham/njsscan-action@master
with:
args: './apps/backend/user'

0 comments on commit b378bcd

Please sign in to comment.