Skip to content

Commit

Permalink
Add gihub action
Browse files Browse the repository at this point in the history
  • Loading branch information
version-1 committed Feb 21, 2024
1 parent ad77667 commit 729b913
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 23 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Frontend/Backend pipeline
run-name: Frontend/Backend pipeline
on: [push]
jobs:
fe-pipeline:
name: Frontend Pipeline
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend/core
steps:
- name: Setup Test Environment
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Cache node_modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-fe-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Install dependencies
run: npm install
- name: Lint
- run: npm run lint
- name: Compile
- run: npm run tsc
- name: Test
- run: npm run test
- name: Build
- run: npm run build
be-pipeline:
name: Backend Pipeline
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./api
steps:
- name: Setup Test Environment
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Cache node_modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-be-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
name: List the state of node modules
continue-on-error: true
run: npm list
- name: Install dependencies
run: npm install
- name: Lint
- run: npm run lint
- name: Compile
- run: npm run tsc
- name: Build
- run: npm run build
- name: Test
- run: npm run test
22 changes: 0 additions & 22 deletions api/src/app.controller.spec.ts

This file was deleted.

3 changes: 2 additions & 1 deletion frontend/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"build": "next build",
"start": "npx serve",
"lint": "next lint",
"tsc": "tsc --project tsconfig.json"
"tsc": "tsc --project tsconfig.json",
"test": "echo 0"
},
"dependencies": {
"@types/node": "20.5.1",
Expand Down

0 comments on commit 729b913

Please sign in to comment.