Change the CI GHA to a matrix job
This commit is contained in:
		
							parent
							
								
									047de19424
								
							
						
					
					
						commit
						149eb70b89
					
				
							
								
								
									
										104
									
								
								.github/workflows/ci.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										104
									
								
								.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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user