Skip to content

Commit

Permalink
Merge pull request #62 from 0LNetworkCommunity/feat/git-workflow
Browse files Browse the repository at this point in the history
Add Workflow Files for API and Web-App Applications
  • Loading branch information
soaresa authored Nov 9, 2024
2 parents 4f922c5 + f238777 commit 5a525dd
Show file tree
Hide file tree
Showing 2 changed files with 85 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI-API

on:
push:
branches:
- main
- build-test
pull_request:
branches:
- main
- build-test

jobs:
build-api:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Cache dependencies
uses: actions/cache@v3
with:
path: api/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('api/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm install
working-directory: api

- name: Build project
run: npm run build
working-directory: api

# TODO: run tests for this app
#- name: Run tests
# run: npm test
# working-directory: api
41 changes: 41 additions & 0 deletions .github/workflows/ci-web-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI-Web-App

on:
push:
branches:
- main
- build-test
pull_request:
branches:
- main
- build-test

jobs:
build-web-app:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Clean up node_modules and package-lock
run: |
rm -rf web-app/node_modules
rm -f web-app/package-lock.json
- name: Install dependencies
run: npm install
working-directory: web-app

- name: Build project
run: npm run build
working-directory: web-app

# TODO: run tests for this app
#- name: Run tests
# run: npm test
# working-directory: web-app

0 comments on commit 5a525dd

Please sign in to comment.