Automation/Cypress

cypress - github actions

c29130811 2023. 3. 9. 11:54

Github Action은 CI/CD 즉 지속적인 통합/ 배포을 지원해주는 서비스로, 빌드, 테스트 릴리즈를 할 수 있게 도와준다.

 

cypress 에 공식 문서에서도 볼 수 있듯이, github actions를 통해 테스트를 CI/CD 를 통해 할 수 있게 끔 지원해준다.

 

https://docs.cypress.io/guides/continuous-integration/github-actions

 

GitHub Actions | Cypress Documentation

What you'll learn

docs.cypress.io

 

사실 꼭 github actions가 아니더라도, circleCI, gitlab CI, AWS CodeBild 등 여러가지로 할 수 있다.

 

github actions는 무료로 2,000 분을 무료로 지원해주기 때문에, 테스트로 해보는 것도 사실 괜찮은거 같음. 

 

자세한 유로 모델 정리는 링크 참고

https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions

 

About billing for GitHub Actions - GitHub Docs

About billing for GitHub Actions GitHub Actions usage is free for standard GitHub-hosted runners in public repositories, and for self-hosted runners. For private repositories, each GitHub account receives a certain amount of free minutes and storage for us

docs.github.com

예제로 cypress 프로젝트 하나를 github에 repository 등록 후, Actions 탭을 통해 추가해서 테스트 해봤다.

 

Repository 의 Tab에서 Actions를 누르면 여러가지 설정 가능한 요소들이 출력 됨.

저기에서 "set up a workflow yourself" 를 누르면 실제 내가 작성하는 영역이 출력 된다.

이제 내용을 채울 차례인데, 사실 yml 작성에 대해 잘 알지 못해 또 알아봐야 했음.

 

cypress의 yml 작성은 아래에 예제들이 많이 되어있긴 하다.

https://github.com/cypress-io/github-action

 

GitHub - cypress-io/github-action: GitHub Action for running Cypress end-to-end & component tests

GitHub Action for running Cypress end-to-end & component tests - GitHub - cypress-io/github-action: GitHub Action for running Cypress end-to-end & component tests

github.com

위에 yml 테스트 한다고 커밋 푸시만 계속 반복해서 해본거 같다.

결론적으로, cypress에 record와 같은 내용을 firefox, chrome 으로 돌려봤는데 잘 되는거 같다.

yml 작성이랑 pipeline을 해보는걸 좀 차근차근 익혀봐야할것 같다.

728x90