Skip to content

main 브랜치에 submodules 추가 (issue #310) #196

main 브랜치에 submodules 추가 (issue #310)

main 브랜치에 submodules 추가 (issue #310) #196

Workflow file for this run

name: FRONT_CI
on:
pull_request:
types: [ opened, reopened, synchronize ]
branches: [ 'main' ]
env:
lilychoibb: ${{secrets.LILYCHOIBB_SLACK_ID}}
robinjoon: ${{secrets.ROBINJOON_SLACK_ID}}
brgndyy: ${{secrets.BRGNDYY_SLACK_ID}}
chosim-dvlpr: ${{secrets.CHOSIM_DVLPR_SLACK_ID}}
Minjoo522: ${{secrets.MINJOO522_SLACK_ID}}
alstn113: ${{secrets.ALSTN113_SLACK_ID}}
le2sky: ${{secrets.LE2SKY_SLACK_ID}}
Parkhanyoung: ${{secrets.PARKHANYOUNG_SLACK_ID}}
jobs:
PATH_CHANGES:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
frontend: ${{ steps.changes.outputs.frontend }}
steps:
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
frontend:
- 'frontend/**'
FE_CI:
runs-on: ubuntu-latest
needs: PATH_CHANGES
if: ${{ needs.PATH_CHANGES.outputs.frontend == 'true' }}
permissions:
contents: read
packages: write
actions: write
outputs:
lint: ${{ steps.npm_run_lint_result.outputs.result }}
build: ${{ steps.npm_run_build_result.outputs.result }}
test: ${{ steps.npm_run_test_result.outputs.result }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20.15.1'
- name: Install dependencies
run: |
cd frontend
npm install
- name: Run lint
continue-on-error: true
id: npm_run_lint
run: |
cd frontend
npm run lint
- name: Save Run lint result
continue-on-error: true
id: npm_run_lint_result
run: |
echo "result=${{steps.npm_run_lint.outcome}}" >> $GITHUB_OUTPUT
- name: Run build
continue-on-error: true
id: npm_run_build
run: |
pwd
cd frontend
npm run build
- name: Save Run build result
continue-on-error: true
id: npm_run_build_result
run: |
echo "result=${{steps.npm_run_build.outcome}}" >> $GITHUB_OUTPUT
- name: Run test
continue-on-error: true
id: npm_run_test
run: |
cd frontend
npm run test
- name: Save Run test result
continue-on-error: true
id: npm_run_test_result
run: |
echo "result=${{steps.npm_run_test.outcome}}" >> $GITHUB_OUTPUT
FE_SLACK_MESSAGE:
runs-on: ubuntu-latest
needs: FE_CI
if: ${{needs.FE_CI.result != 'skipped'}}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Get teamMember
id: teamMember
run: |
echo "SENDER_SLACK_ID=${{ env[github.event.sender.login] }}" >> $GITHUB_ENV
- name: Slack mention
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.ISSUE_CHANNEL }}
payload: |
{
"text": "pr 테스트 결과",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "pr 테스트 결과\n lint : ${{ needs.FE_CI.outputs.lint }} \n build : ${{ needs.FE_CI.outputs.build }} \n test : ${{ needs.FE_CI.outputs.test }} \n • 링크: <${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}> \n • pr 담당자: <@${{ env.SENDER_SLACK_ID }}>"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.BOT_TOKEN }}