Skip to content

Add gihub action

Add gihub action #3

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:

Check failure on line 11 in .github/workflows/github-actions.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/github-actions.yml

Invalid workflow file

You have an error in your yaml syntax on line 11
- 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