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

[FE] Github Actions로 CI 구축 #96

Merged
merged 25 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bcd0750
ci: CI를 위한 yml 파일 작성
ImxYJL Jul 23, 2024
a3e0507
ci: yarn.lock 경로 추가
ImxYJL Jul 23, 2024
5f8ea30
ci: working-directory 추가
ImxYJL Jul 23, 2024
af0db92
cI: 동작 테스트를 위해 push 브랜치 경로 조건에서 frontend 임시 제거
ImxYJL Jul 23, 2024
0feb7b7
ci: 테스트를 위해 현재 브랜치도 조건에 추가
ImxYJL Jul 23, 2024
437f9eb
ci: package에 test 명령어 추가
ImxYJL Jul 23, 2024
835e826
ci: yarn.lock 파일 업데이트
ImxYJL Jul 23, 2024
fb7c128
ci: 충돌 해결 및 테스트용 테스트 파일 업로드
ImxYJL Jul 23, 2024
68b6583
ci: 테스트 파일 형식 수정
ImxYJL Jul 23, 2024
5bc3531
chore: 필요없는 파일 삭제
ImxYJL Jul 23, 2024
5c2b819
chore: svg 파일을 대문자로 import한 것들 소문자로 수정
ImxYJL Jul 24, 2024
84c5e69
ci: 웹팩 env 설정 업데이트
ImxYJL Jul 24, 2024
992dc53
ci: process.env 사용을 위한 타입 설정
ImxYJL Jul 24, 2024
74681a1
ci: env 웹팩 설정 경로를 절대 경로로 변경
ImxYJL Jul 24, 2024
6f6fb09
ci: env 웹팩 설정 경로 수정
ImxYJL Jul 24, 2024
71baf92
ci: env 절대경로 수정
ImxYJL Jul 24, 2024
0cb6fcb
ci: 절대경로 수정 2
ImxYJL Jul 24, 2024
5d2cda3
ci: 읽기 권한을 명시적으로 주고 테스트
ImxYJL Jul 24, 2024
fd251b0
ci: dist 파일 테스트
ImxYJL Jul 24, 2024
82f513c
ci: CI 환경에서도 env 파일 생성
ImxYJL Jul 24, 2024
1efac50
ci: 배포 정상 동작 확인을 위한 github pages 임시 배포 설정
ImxYJL Jul 24, 2024
4f21be9
ci: 임시 배포 코드 삭제
ImxYJL Jul 24, 2024
9034df0
ci: develop 브랜치로 frontend 이하 경로에서 PR이 올라올 때 CI가 실행되도록 수정
ImxYJL Jul 24, 2024
eb374c2
ci: node 설치 에러 해결
ImxYJL Jul 24, 2024
bbbb08e
Merge branch 'develop' of https://github.com/woowacourse-teams/2024-r…
ImxYJL Jul 25, 2024
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
48 changes: 48 additions & 0 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build test with Webpack
on:
pull_request:
branches:
- develop
paths:
- "frontend/**"
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency: # NOTE: action 도중 새 PR이 올라오면 기존 action 취소
group: "ci-group"
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout to current repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "yarn"
cache-dependency-path: ./frontend/yarn.lock

- name: Create .env file
run: echo "API_BASE_URL=${{ secrets.API_BASE_URL }}" > ./frontend/.env

- name: Set environment file permissions
run: chmod 644 ./frontend/.env

- name: Install dependencies
run: yarn install --frozen-lockfile
working-directory: frontend

- name: Run tests
run: yarn test
working-directory: frontend

- name: Build
run: yarn build
env:
API_BASE_URL: ${{ secrets.API_BASE_URL }}
working-directory: frontend
6 changes: 2 additions & 4 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
"lint:styles": "stylelint \"src/**/styles.ts\" --fix",
"test": "jest"
},
"jest": {
"testEnvironment": "jest-environment-jsdom"
},
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
Expand All @@ -25,7 +22,8 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-router": "^6.24.1",
"react-router-dom": "^6.24.1"
"react-router-dom": "^6.24.1",
"jest": "^29.7.0"
},
"devDependencies": {
"@babel/core": "^7.24.7",
Expand Down
5 changes: 3 additions & 2 deletions frontend/src/components/layouts/Sidebar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { useLocation, Link } from 'react-router-dom';

import CloseIcon from '../../../assets/close.svg';
import LogoIcon from '../../../assets/logo.svg';
import CloseIcon from '@/assets/close.svg';
import LogoIcon from '@/assets/logo.svg';

import { PAGE } from '../../../constants';

import * as S from './styles';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import LockIcon from '../../../../assets/Lock.svg';
import UnlockIcon from '../../../../assets/Unlock.svg';
//import UnlockIcon from '@/assets/Unlock.svg';
import LockIcon from '@/assets/lock.svg';
import UnlockIcon from '@/assets/unLock.svg';

interface LockButtonProps {
isLock: boolean;
Expand Down
4 changes: 4 additions & 0 deletions frontend/tempTest.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
test('테스트하자!', () => {
const onePlusOne = 1 + 1;
expect(onePlusOne).toBe(2);
});
2 changes: 1 addition & 1 deletion frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@/*": ["src/*"]
},
"jsxImportSource": "@emotion/react",
"types": ["jest", "@testing-library/jest-dom"]
"types": ["node", "jest", "@testing-library/jest-dom"]
},
"include": ["src", "**/*.tsx", "types.d.ts"],
"exclude": ["node_modules", "dist"]
Expand Down
1 change: 1 addition & 0 deletions frontend/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ module.exports = (env, argv) => {
}),
new CleanWebpackPlugin(),
new Dotenv({
systemvars: true,
path: './.env',
}),
],
Expand Down
6 changes: 3 additions & 3 deletions frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1825,9 +1825,9 @@
pretty-format "^27.0.2"

"@testing-library/jest-dom@^6.4.7":
version "6.4.7"
resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.4.7.tgz#0f882b745f17a6a094d1d64d835a9440429f90f4"
integrity sha512-GaKJ0nijoNf30dWSOOzQEBkWBRk4rG3C/efw8zKrimNuZpnS/6/AEwo0WvZHgJxG84cNCgxt+mtbe1fsvfLp2A==
version "6.4.8"
resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.4.8.tgz#9c435742b20c6183d4e7034f2b329d562c079daa"
integrity sha512-JD0G+Zc38f5MBHA4NgxQMR5XtO5Jx9g86jqturNTt2WUfRmLDIY7iKkWHDCCTiDuFMre6nxAD5wHw9W5kI4rGw==
dependencies:
"@adobe/css-tools" "^4.4.0"
"@babel/runtime" "^7.9.2"
Expand Down