mirror of
https://github.com/mempool/mempool.git
synced 2025-03-03 17:47:01 +01:00
Change the CI GHA to a matrix job
This commit is contained in:
parent
8e8609371f
commit
f4389e11ba
1 changed files with 50 additions and 54 deletions
102
.github/workflows/ci.yml
vendored
102
.github/workflows/ci.yml
vendored
|
@ -1,92 +1,88 @@
|
||||||
name: CI Pipeline for the Backend and Frontend
|
name: CI Pipeline for the Backend and Frontend
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
env:
|
env:
|
||||||
NODE_VERSION: 16.15.0
|
NODE_VERSION: 16.15.0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build_backend_dev:
|
backend:
|
||||||
name: Build backend (Development)
|
strategy:
|
||||||
runs-on: ubuntu-latest
|
matrix:
|
||||||
|
flavor: ['dev', 'prod']
|
||||||
|
runs-on: 'ubuntu-latest'
|
||||||
|
|
||||||
|
name: Backend (${{ matrix.flavor }})
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
path: dev
|
path: ${{ matrix.flavor }}
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
|
|
||||||
- name: Install
|
- name: Install
|
||||||
|
if: ${{ matrix.flavor == 'dev'}}
|
||||||
run: npm install
|
run: npm install
|
||||||
working-directory: dev/backend
|
working-directory: ${{ matrix.flavor }}/backend
|
||||||
|
|
||||||
|
- name: Install (Prod dependencies only)
|
||||||
|
if: ${{ matrix.flavor == 'prod'}}
|
||||||
|
run: npm install --prod
|
||||||
|
working-directory: ${{ matrix.flavor }}/backend
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
|
if: ${{ matrix.flavor == 'dev'}}
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
working-directory: dev/backend
|
working-directory: ${{ matrix.flavor }}/backend
|
||||||
|
|
||||||
# - name: Test
|
# - name: Test
|
||||||
# run: npm run test
|
# run: npm run test
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
working-directory: dev/backend
|
working-directory: ${{ matrix.flavor }}/backend
|
||||||
build_frontend_dev:
|
|
||||||
name: Build frontend (Development)
|
frontend:
|
||||||
runs-on: ubuntu-latest
|
strategy:
|
||||||
|
matrix:
|
||||||
|
flavor: ['dev', 'prod']
|
||||||
|
runs-on: 'ubuntu-latest'
|
||||||
|
|
||||||
|
name: Frontend (${{ matrix.flavor }})
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
path: dev
|
path: ${{ matrix.flavor }}
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
- name: Install
|
|
||||||
|
- name: Install (Prod dependencies only)
|
||||||
run: npm install
|
run: npm install
|
||||||
working-directory: dev/frontend
|
if: ${{ matrix.flavor == 'prod'}}
|
||||||
|
working-directory: ${{ matrix.flavor }}/frontend
|
||||||
|
|
||||||
|
- name: Install
|
||||||
|
if: ${{ matrix.flavor == 'dev'}}
|
||||||
|
run: npm install
|
||||||
|
working-directory: ${{ matrix.flavor }}/frontend
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
working-directory: dev/frontend
|
working-directory: ${{ matrix.flavor }}/frontend
|
||||||
|
|
||||||
# - name: Test
|
# - name: Test
|
||||||
# run: npm run test
|
# run: npm run test
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
working-directory: dev/frontend
|
working-directory: ${{ matrix.flavor }}/frontend
|
||||||
build_backend_prod:
|
|
||||||
name: Build backend (Prod Dependencies)
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
path: prod
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
|
||||||
registry-url: 'https://registry.npmjs.org'
|
|
||||||
- name: Install
|
|
||||||
run: npm install --prod
|
|
||||||
working-directory: prod/backend
|
|
||||||
- name: Build
|
|
||||||
run: npm run build
|
|
||||||
working-directory: prod/backend
|
|
||||||
build_frontend_prod:
|
|
||||||
name: Build frontend (Prod Dependencies)
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
path: prod
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
|
||||||
registry-url: 'https://registry.npmjs.org'
|
|
||||||
- name: Install
|
|
||||||
run: npm install --prod
|
|
||||||
working-directory: prod/frontend
|
|
||||||
- name: Build
|
|
||||||
run: npm run build
|
|
||||||
working-directory: prod/frontend
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue