728x90
반응형
devel, main에서 각각의 workflow를 따를 예정인데 이를 github actions를 통해 진행해보고자 한다.
feature branch에서 개발이 끝나고 devel로 PR이 생성될 때 또는 devel branch로 push가 일어났을 때
자동으로 테스트를 해주도록 다음을 작성하였다.
.github/workflows/ci.yml <-- .github/workflows 까지는 약속임
name: devel workflow <----- name 설정 안해도 되지만 하는 것을 추천
on:
push:
branches:
- devel
pull_request:
branches:
- devel
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '18.18.0'
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Lint
run: npm run lint
- name: Test
run: npm run test
CI 테스트를 위해서 test branch(feature)에서 devel branch로 pr을 생성했다.
무언가 열심히 체크하고
성공 -!
Pull requests의 목록에서도 확인할 수 있고
Actions에서 어떤 branch에서 어떤 workflow에 따라 실행하는지도 확인할 수 있다.
1 : devel에 push
2 : test branch에서 devel branch로 pr 생성
3 : devel branch에서 test branch를 merge(push)
너무조하......
docker에 올리는 서버와 연동하는 것은 TBC......!
728x90
반응형
'Tips > Git' 카테고리의 다른 글
[Git] worktree 사용하기 (0) | 2024.07.18 |
---|---|
[Git] Github Actions + Test Coverage (jest) (0) | 2024.04.26 |
[Git] 04. cherry-pick (0) | 2021.06.10 |
[Git] 03. branch 생성, merge, rebase (0) | 2021.06.10 |
[Git] 02. add, commit, push 취소하기 (0) | 2021.06.10 |