Skip to content

Commit

Permalink
fix github action ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
younes200 committed Oct 5, 2023
1 parent eeaf4ee commit 44b355a
Show file tree
Hide file tree
Showing 10 changed files with 762 additions and 43 deletions.
34 changes: 30 additions & 4 deletions .github/workflows/dockerfile-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,46 @@ jobs:
matrix:
node-version: [16.x]

services:
redis:
image: redis
ports:
- "0.0.0.0:6379:6379"
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- "0.0.0.0:5432:5432"
# needed because the postgres container does not provide a healthcheck
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: "Run docker server build"
run: docker compose -f stack.yml up
# - name: "Run docker backend build"
# run:
# docker build --build-arg APP=backend --build-arg START_COMMAND=start -t celluloid-backend:latest .

- name: "Run docker frontend build"
run:
docker build --build-arg APP=frontend --build-arg START_COMMAND=start -t celluloid-frontend:latest .

- name: "Start docker server"
run:
docker run -p 3000:3000 -e PORT=3000 celluloid-frontend:latest


- name: "Test docker"
run: node .github/workflows/test-docker.js


- name: "Tear down docker"
run: docker compose down
run: docker kill celluloid-frontend
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn commitlint ${1}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
Binary file modified .yarn/install-state.gz
Binary file not shown.
3 changes: 2 additions & 1 deletion apps/frontend/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export const Footer: React.FC<FooterProps> = (props) => (
<Trans
i18nKey={"footer.copyright"}
defaults="© 2018 Institut Catholique de Paris"
/>
/>{" "}
version: {JSON.stringify(process.env)}
</Typography>
</Box>
</Grid>
Expand Down
8 changes: 0 additions & 8 deletions celluloid.code-workspace

This file was deleted.

1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ["@commitlint/config-conventional"] };
9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"i18n:sync": "yarn workspace translations sync",
"database:migrate": "./scripts/docker-bootstrap.sh admin",
"eslint": "eslint --ext .js,.jsx,.ts,.tsx",
"prepare": "husky install",
"prettier:all": "prettier --ignore-path .eslintignore \"**/*.{js,jsx,ts,tsx,md}\"",
"--shortcuts to run commands in workspaces--": "",
"frontend": "yarn workspace frontend",
Expand All @@ -27,6 +28,8 @@
"docker-build": "docker build -t celluloid:local ."
},
"devDependencies": {
"@commitlint/cli": "^17.7.2",
"@commitlint/config-conventional": "^17.7.0",
"@types/jest": "^26.0.23",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
Expand All @@ -40,7 +43,9 @@
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^8.0.0",
"eslint_d": "^12.2.1",
"husky": "^8.0.3",
"jest": "^27.0.1",
"lint-staged": "^14.0.1",
"mock-req": "^0.2.0",
"mock-res": "^0.5.0",
"prettier": "^2.3.0",
Expand Down Expand Up @@ -76,5 +81,9 @@
"packageManager": "yarn@3.4.1",
"engines": {
"node": ">=20"
},
"lint-staged": {
"*.{js,ts,tsx,jsx}": "eslint --cache --fix",
"*.{js,css,md,ts,tsx,jsx}": "prettier --write"
}
}
Loading

0 comments on commit 44b355a

Please sign in to comment.