Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

826: Add pre-commit hook used in lib #16

Merged
merged 6 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/lint-test-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Lint, test and build
on: [push]
jobs:
cache-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }}
- name: Installing dependencies
run: npm i
DutchBen marked this conversation as resolved.
Show resolved Hide resolved

tsc-and-linting:
runs-on: ubuntu-latest
needs: cache-dependencies
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }}
- name: Installing dependencies
run: npm i
- run: npm run tsc
- run: npm run lint

unit-tests:
runs-on: ubuntu-latest
needs: cache-dependencies
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }}
- name: Installing dependencies
run: npm i
- run: npm run test

build:
runs-on: ubuntu-latest
needs: cache-dependencies
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/package.json') }}
- name: Installing dependencies
run: npm i
- run: npm run build
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,5 @@ yarn-error.log*
# vercel
.vercel

# lockfiles
package-lock.json
yarn.lock

# typescript
tsconfig.tsbuildinfo
11 changes: 11 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

echo "---------- Running TSC ----------"
npm run tsc

echo "---------- Running Linter ----------"
npm run lint

echo "---------- Running Tests ----------"
npm run test
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ FROM node:18-alpine AS builder

WORKDIR /build
COPY . .
RUN yarn install
RUN yarn build --no-lint
RUN npm install && npm update @orchestrator-ui/orchestrator-ui-components && npm update @orchestrator-ui/eslint-config-custom && npm update @orchestrator-ui/jest-config && npm update @orchestrator-ui/tsconfig
RUN npm run build


FROM node:18-alpine AS runner

Expand All @@ -16,4 +17,6 @@ COPY --chown=node --from=builder /build .

USER node
EXPOSE 3000
CMD yarn start
CMD npm start


Loading
Loading