2022-06-27 21:28:21 -07:00
|
|
|
name: CI Pipeline for the Backend and Frontend
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-06-27 21:28:21 -07:00
|
|
|
on:
|
2022-07-06 16:29:38 -07:00
|
|
|
pull_request:
|
2022-07-08 04:40:05 -07:00
|
|
|
types: [opened, review_requested, synchronize]
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-06-27 21:28:21 -07:00
|
|
|
jobs:
|
2022-07-05 05:37:17 -07:00
|
|
|
backend:
|
2022-07-06 16:29:38 -07:00
|
|
|
if: "!contains(github.event.pull_request.labels.*.name, 'ops') && !contains(github.head_ref, 'ops/')"
|
2022-07-05 05:37:17 -07:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-07-08 04:40:05 -07:00
|
|
|
node: ["16.16.0", "18.5.0"]
|
|
|
|
flavor: ["dev", "prod"]
|
2022-07-08 04:49:51 -07:00
|
|
|
fail-fast: false
|
2022-07-08 04:40:05 -07:00
|
|
|
runs-on: "ubuntu-latest"
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-07-08 04:40:05 -07:00
|
|
|
name: Backend (${{ matrix.flavor }}) - node ${{ matrix.node }}
|
2022-06-27 21:28:21 -07:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2022-07-05 04:46:13 -07:00
|
|
|
with:
|
2022-07-08 04:40:05 -07:00
|
|
|
path: ${{ matrix.node }}/${{ matrix.flavor }}
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-06-27 21:28:21 -07:00
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
2022-07-08 04:40:05 -07:00
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
registry-url: "https://registry.npmjs.org"
|
2022-07-05 05:37:17 -07:00
|
|
|
|
|
|
|
- name: Install
|
|
|
|
if: ${{ matrix.flavor == 'dev'}}
|
2022-07-06 23:38:06 +02:00
|
|
|
run: npm ci
|
2022-07-08 04:40:05 -07:00
|
|
|
working-directory: ${{ matrix.node }}/${{ matrix.flavor }}/backend
|
2022-07-05 05:37:17 -07:00
|
|
|
|
|
|
|
- name: Install (Prod dependencies only)
|
|
|
|
if: ${{ matrix.flavor == 'prod'}}
|
2022-07-07 18:32:18 +02:00
|
|
|
run: npm ci --omit=dev --omit=optional
|
2022-07-08 04:40:05 -07:00
|
|
|
working-directory: ${{ matrix.node }}/${{ matrix.flavor }}/backend
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-07-08 04:40:05 -07:00
|
|
|
- name: Lint
|
2022-07-05 05:37:17 -07:00
|
|
|
if: ${{ matrix.flavor == 'dev'}}
|
2022-07-05 04:30:56 -07:00
|
|
|
run: npm run lint
|
2022-07-08 04:40:05 -07:00
|
|
|
working-directory: ${{ matrix.node }}/${{ matrix.flavor }}/backend
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-07-09 00:08:49 +02:00
|
|
|
- name: Unit Tests
|
2022-07-07 12:23:21 -07:00
|
|
|
if: ${{ matrix.flavor == 'dev'}}
|
|
|
|
run: npm run test
|
2022-07-09 00:08:49 +02:00
|
|
|
working-directory: ${{ matrix.node }}/${{ matrix.flavor }}/backend
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-06-27 21:28:21 -07:00
|
|
|
- name: Build
|
|
|
|
run: npm run build
|
2022-07-08 04:40:05 -07:00
|
|
|
working-directory: ${{ matrix.node }}/${{ matrix.flavor }}/backend
|
2022-07-05 05:37:17 -07:00
|
|
|
|
|
|
|
frontend:
|
2022-07-06 16:29:38 -07:00
|
|
|
if: "!contains(github.event.pull_request.labels.*.name, 'ops') && !contains(github.head_ref, 'ops/')"
|
2022-07-05 05:37:17 -07:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-07-08 04:40:05 -07:00
|
|
|
node: ["16.15.0", "18.5.0"]
|
|
|
|
flavor: ["dev", "prod"]
|
2022-07-08 05:13:26 -07:00
|
|
|
fail-fast: false
|
2022-07-08 04:40:05 -07:00
|
|
|
runs-on: "ubuntu-latest"
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-07-08 04:40:05 -07:00
|
|
|
name: Frontend (${{ matrix.flavor }}) - node ${{ matrix.node }}
|
2022-07-05 04:42:04 -07:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
2022-07-05 04:46:13 -07:00
|
|
|
with:
|
2022-07-08 04:40:05 -07:00
|
|
|
path: ${{ matrix.node }}/${{ matrix.flavor }}
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-07-05 04:42:04 -07:00
|
|
|
- name: Setup Node
|
|
|
|
uses: actions/setup-node@v3
|
|
|
|
with:
|
2022-07-08 04:40:05 -07:00
|
|
|
node-version: ${{ matrix.node }}
|
|
|
|
registry-url: "https://registry.npmjs.org"
|
2022-07-05 05:37:17 -07:00
|
|
|
|
|
|
|
- name: Install (Prod dependencies only)
|
2022-07-07 18:32:18 +02:00
|
|
|
run: npm ci --omit=dev --omit=optional
|
2022-07-05 05:37:17 -07:00
|
|
|
if: ${{ matrix.flavor == 'prod'}}
|
2022-07-08 04:40:05 -07:00
|
|
|
working-directory: ${{ matrix.node }}/${{ matrix.flavor }}/frontend
|
2022-07-05 05:37:17 -07:00
|
|
|
|
|
|
|
- name: Install
|
|
|
|
if: ${{ matrix.flavor == 'dev'}}
|
2022-07-06 23:38:06 +02:00
|
|
|
run: npm ci
|
2022-07-08 04:40:05 -07:00
|
|
|
working-directory: ${{ matrix.node }}/${{ matrix.flavor }}/frontend
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-07-06 23:38:05 +02:00
|
|
|
- name: Lint
|
|
|
|
if: ${{ matrix.flavor == 'dev'}}
|
2022-07-05 04:42:04 -07:00
|
|
|
run: npm run lint
|
2022-07-08 04:40:05 -07:00
|
|
|
working-directory: ${{ matrix.node }}/${{ matrix.flavor }}/frontend
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-07-08 04:40:05 -07:00
|
|
|
# - name: Test
|
2022-07-05 04:42:04 -07:00
|
|
|
# run: npm run test
|
2022-07-05 05:37:17 -07:00
|
|
|
|
2022-07-05 04:42:04 -07:00
|
|
|
- name: Build
|
|
|
|
run: npm run build
|
2022-07-08 04:40:05 -07:00
|
|
|
working-directory: ${{ matrix.node }}/${{ matrix.flavor }}/frontend
|