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:
|
2023-09-30 08:57:57 -07:00
|
|
|
node: ["18", "20"]
|
2022-07-08 04:40:05 -07:00
|
|
|
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
|
|
|
|
2023-08-21 10:17:35 -07:00
|
|
|
- name: Read rust-toolchain file from repository
|
|
|
|
id: gettoolchain
|
|
|
|
run: echo "::set-output name=toolchain::$(cat rust-toolchain)"
|
|
|
|
working-directory: ${{ matrix.node }}/${{ matrix.flavor }}
|
|
|
|
|
|
|
|
- name: Install ${{ steps.gettoolchain.outputs.toolchain }} Rust toolchain
|
|
|
|
# Latest version available on this commit is 1.71.1
|
|
|
|
# Commit date is Aug 3, 2023
|
|
|
|
uses: dtolnay/rust-toolchain@f361669954a8ecfc00a3443f35f9ac8e610ffc06
|
|
|
|
with:
|
|
|
|
toolchain: ${{ steps.gettoolchain.outputs.toolchain }}
|
2023-06-27 16:12:39 -07:00
|
|
|
|
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'}}
|
2023-08-06 08:01:28 -07:00
|
|
|
run: npm run test:ci
|
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:
|
2023-09-30 08:57:57 -07:00
|
|
|
node: ["18", "20"]
|
2022-07-08 04:40:05 -07:00
|
|
|
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
|
2023-07-21 18:14:32 +09:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|