Skip to content

cd: set-up terraform #558

cd: set-up terraform

cd: set-up terraform #558

Workflow file for this run

name: Format & Lint Microservices
on:
push:
branches:
- main
pull_request:
branches:
- "**"
jobs:
format-check-all:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
cache: "npm"
- name: Run Prettier Checks
run: npm run format:check
matching-ui-lint:
runs-on: ubuntu-latest
steps:
- name: Set REVIEWDOG_GITHUB_API_TOKEN
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
cache: "npm"
- name: Install dependencies
run: |
cd ./ui-services/matching-ui-service
npm install --frozen-lockfile
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run ESLint and Reviewdog
run: |
cd ./ui-services/matching-ui-service
exit_code=0
npx eslint . || exit_code=$?
eslint_exit_code=$exit_code
if [ $eslint_exit_code -ne 0 ]; then
echo "ESLint failed for matching-ui"
exit 1
fi
npx eslint --format json . > eslint-report.json
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
question-ui-lint:
runs-on: ubuntu-latest
steps:
- name: Set REVIEWDOG_GITHUB_API_TOKEN
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
cache: "npm"
- name: Install dependencies
run: |
cd ./ui-services/question-ui-service
npm install --frozen-lockfile
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run ESLint and Reviewdog
run: |
cd ./ui-services/question-ui-service
exit_code=0
npx eslint . || exit_code=$?
eslint_exit_code=$exit_code
if [ $eslint_exit_code -ne 0 ]; then
echo "ESLint failed for question-ui"
exit 1
fi
npx eslint --format json . > eslint-report.json
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
collab-ui-lint:
runs-on: ubuntu-latest
steps:
- name: Set REVIEWDOG_GITHUB_API_TOKEN
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
cache: "npm"
- name: Install dependencies
run: |
cd ./ui-services/collab-ui-service
npm install --frozen-lockfile
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run ESLint and Reviewdog
run: |
cd ./ui-services/collab-ui-service
exit_code=0
npx eslint . || exit_code=$?
eslint_exit_code=$exit_code
if [ $eslint_exit_code -ne 0 ]; then
echo "ESLint failed for collab-ui"
exit 1
fi
npx eslint --format json . > eslint-report.json
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
user-ui-lint:
runs-on: ubuntu-latest
steps:
- name: Set REVIEWDOG_GITHUB_API_TOKEN
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
cache: "npm"
- name: Install dependencies
run: |
cd ./ui-services/user-ui-service
npm install --frozen-lockfile
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run ESLint and Reviewdog
run: |
cd ./ui-services/user-ui-service
exit_code=0
npx eslint . || exit_code=$?
eslint_exit_code=$exit_code
if [ $eslint_exit_code -ne 0 ]; then
echo "ESLint failed for question-ui"
exit 1
fi
npx eslint --format json . > eslint-report.json
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
history-ui-lint:
runs-on: ubuntu-latest
steps:
- name: Set REVIEWDOG_GITHUB_API_TOKEN
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
cache: "npm"
- name: Install dependencies
run: |
cd ./ui-services/history-ui-service
npm install --frozen-lockfile
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run ESLint and Reviewdog
run: |
cd ./ui-services/history-ui-service
exit_code=0
npx eslint . || exit_code=$?
eslint_exit_code=$exit_code
if [ $eslint_exit_code -ne 0 ]; then
echo "ESLint failed for collab-ui"
exit 1
fi
npx eslint --format json . > eslint-report.json
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
ui-shell-lint:
runs-on: ubuntu-latest
steps:
- name: Set REVIEWDOG_GITHUB_API_TOKEN
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
cache: "npm"
- name: Install dependencies
run: |
cd ./ui-shell
npm install --frozen-lockfile
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run ESLint and Reviewdog
run: |
cd ./ui-shell
exit_code=0
npx eslint . || exit_code=$?
eslint_exit_code=$exit_code
if [ $eslint_exit_code -ne 0 ]; then
echo "ESLint failed for collab-ui"
exit 1
fi
npx eslint --format json . > eslint-report.json
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
question-backend-lint:
runs-on: ubuntu-latest
steps:
- name: Set REVIEWDOG_GITHUB_API_TOKEN
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
cache: "npm"
- name: Install dependencies
run: |
cd ./backend-services/question-backend-service
npm ci
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run ESLint and Reviewdog
run: |
cd ./backend-services/question-backend-service
exit_code=0
npx eslint . || exit_code=$?
eslint_exit_code=$exit_code
if [ $eslint_exit_code -ne 0 ]; then
echo "ESLint failed for question-backend"
exit 1
fi
npx eslint --format json . > eslint-report.json
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
leetcode-backend-lint:
runs-on: ubuntu-latest
steps:
- name: Set REVIEWDOG_GITHUB_API_TOKEN
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
cache: "npm"
- name: Install dependencies
run: |
cd ./backend-services/leetcode-backend-service
npm ci
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run ESLint and Reviewdog
run: |
cd ./backend-services/leetcode-backend-service
exit_code=0
npx eslint . || exit_code=$?
eslint_exit_code=$exit_code
if [ $eslint_exit_code -ne 0 ]; then
echo "ESLint failed for leetcode-backend"
exit 1
fi
npx eslint --format json . > eslint-report.json
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
user-backend-lint:
runs-on: ubuntu-latest
steps:
- name: Set REVIEWDOG_GITHUB_API_TOKEN
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
cache: "npm"
- name: Install dependencies
run: |
cd ./backend-services/user-backend-service
npm ci
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run ESLint and Reviewdog
run: |
cd ./backend-services/user-backend-service
exit_code=0
npx eslint . || exit_code=$?
eslint_exit_code=$exit_code
if [ $eslint_exit_code -ne 0 ]; then
echo "ESLint failed for user-backend"
exit 1
fi
npx eslint --format json . > eslint-report.json
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
collab-backend-lint:
runs-on: ubuntu-latest
steps:
- name: Set REVIEWDOG_GITHUB_API_TOKEN
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
cache: "npm"
- name: Install dependencies
run: |
cd ./backend-services/collab-backend-service
npm ci
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run ESLint and Reviewdog
run: |
cd ./backend-services/collab-backend-service
exit_code=0
npx eslint . || exit_code=$?
eslint_exit_code=$exit_code
if [ $eslint_exit_code -ne 0 ]; then
echo "ESLint failed for collab-backend"
exit 1
fi
npx eslint --format json . > eslint-report.json
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
chatting-backend-lint:
runs-on: ubuntu-latest
steps:
- name: Set REVIEWDOG_GITHUB_API_TOKEN
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
cache: "npm"
- name: Install dependencies
run: |
cd ./backend-services/chatting-backend-service
npm ci
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run ESLint and Reviewdog
run: |
cd ./backend-services/chatting-backend-service
exit_code=0
npx eslint . || exit_code=$?
eslint_exit_code=$exit_code
if [ $eslint_exit_code -ne 0 ]; then
echo "ESLint failed for chatting-backend"
exit 1
fi
npx eslint --format json . > eslint-report.json
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
history-backend-lint:
runs-on: ubuntu-latest
steps:
- name: Set REVIEWDOG_GITHUB_API_TOKEN
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
cache: "npm"
- name: Install dependencies
run: |
cd ./backend-services/history-backend-service
npm ci
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run ESLint and Reviewdog
run: |
cd ./backend-services/history-backend-service
exit_code=0
npx eslint . || exit_code=$?
eslint_exit_code=$exit_code
if [ $eslint_exit_code -ne 0 ]; then
echo "ESLint failed for history-backend"
exit 1
fi
npx eslint --format json . > eslint-report.json
cat eslint-report.json | reviewdog -f=eslint -name="eslint" -reporter=github-pr-review -level=error
matching-backend-lint:
runs-on: ubuntu-latest
steps:
- name: Set REVIEWDOG_GITHUB_API_TOKEN
run: echo "REVIEWDOG_GITHUB_API_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup JDK 17
uses: actions/setup-java@v5
with:
java-version: "17"
distribution: "temurin"
cache: "maven"
cache-dependency-path: |
backend-services/matching-backend-service/pom.xml
- name: Spotless check
run: |
cd ./backend-services/matching-backend-service
mvn -B -DskipTests spotless:check
- name: Generate Checkstyle report
run: |
cd ./backend-services/matching-backend-service
mvn -B -DskipTests checkstyle:checkstyle || exit_code=$?
- name: Install reviewdog
uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
- name: Run Checkstyle and Reviewdog
run: |
cd ./backend-services/matching-backend-service
REPORT=target/checkstyle-result.xml
if [ ! -f "$REPORT" ]; then
echo "Checkstyle report not found at $REPORT"
exit 1
fi
cat "$REPORT" | reviewdog -f=checkstyle -name="checkstyle" -reporter=github-pr-review -level=error
- name: Enforce Checkstyle (fail on violations)
run: |
cd ./backend-services/matching-backend-service
mvn -B -DskipTests checkstyle:check