From f3617830d8a927ff7acae9b1b4ad13133dc18af0 Mon Sep 17 00:00:00 2001 From: minjungw00 Date: Thu, 14 Nov 2024 00:30:39 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20PR=20=EC=8B=9C=20=EB=8F=84=EC=BB=A4=20?= =?UTF-8?q?=EC=9D=B4=EB=AF=B8=EC=A7=80=20=EB=B9=8C=EB=93=9C=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=88=98=ED=96=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #085 --- .github/workflows/deploy.yml | 1 + .github/workflows/lint_and_test.yml | 30 ++++++++++++++----- .github/workflows/lint_and_unit_test.yml | 38 ++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/lint_and_unit_test.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 9b92e168..d8f756e7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -7,6 +7,7 @@ on: jobs: deploy: + name: Deploy on Server runs-on: [self-hosted, boost-was] # 라벨에 해당하는 runner로 실행 steps: diff --git a/.github/workflows/lint_and_test.yml b/.github/workflows/lint_and_test.yml index 593aab01..9f7fcdab 100644 --- a/.github/workflows/lint_and_test.yml +++ b/.github/workflows/lint_and_test.yml @@ -1,17 +1,14 @@ name: Lint and Test on: - push: - branches: - - "**" pull_request: branches: - main - dev jobs: - lint_and_test: - name: Lint and Test + lint_and_unit_test: + name: Lint and Unit Test runs-on: ubuntu-latest steps: @@ -34,9 +31,26 @@ jobs: cache: "pnpm" # Run lint - - name: Run lint + - name: Run Lint run: pnpm eslint . - # Run tests - - name: Run tests + # Run Unit tests + - name: Run Unit Tests run: pnpm test + + test_building_docker_image: + name: Test Building Docker Image + runs-on: ubuntu-latest + + steps: + # Checkout the repository + - name: Checkout Repository + uses: actions/checkout@v4 + + # Test Building Docker Images + - name: Test Building Docker Images + env: + NODE_ENV: production + MONGO_URI: ${{ secrets.MONGO_URI }} + run: | + docker-compose build diff --git a/.github/workflows/lint_and_unit_test.yml b/.github/workflows/lint_and_unit_test.yml new file mode 100644 index 00000000..3ddbb2b3 --- /dev/null +++ b/.github/workflows/lint_and_unit_test.yml @@ -0,0 +1,38 @@ +name: Lint and Unit Test + +on: + push: + branches: + - "**" + +jobs: + lint_and_unit_test: + name: Lint and Unit Test + runs-on: ubuntu-latest + + steps: + # Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4 + + # Install pnpm + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + run_install: true + + # Set up Node.js + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + cache: "pnpm" + + # Run lint + - name: Run Lint + run: pnpm eslint . + + # Run Unit tests + - name: Run Unit Tests + run: pnpm test