Skip to content

Commit

Permalink
fix: fix the lint ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Behzad-rabiei committed Oct 23, 2024
1 parent 6267c1d commit cfe6f79
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 58 deletions.
40 changes: 8 additions & 32 deletions .github/workflows/bot-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,18 @@ on:

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: super-linter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TYPESCRIPT_DEFAULT_STYLE: prettier
VALIDATE_DOCKERFILE_HADOLINT: false
VALIDATE_JSCPD: false
VALIDATE_PYTHON_FLAKE8: false
VALIDATE_PYTHON_MYPY: false
uses: ./.github/workflows/lint.yml
with:
app_path: "./bot"

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
cache: "npm"
cache-dependency-path: bot/package-lock.json
- name: Install Dependencies
run: npm install --force
working-directory: ./bot
- name: Run Tests
run: npm run test
working-directory: ./bot
- uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
with:
coverageCommand: npm run test:cov
uses: ./.github/workflows/test.yml
with:
app_path: "./bot"
node_version: "20"
cache_dependency_path: "./bot/package-lock.json"

build-push:
# needs: [lint, test]
needs: [lint, test]
uses: ./.github/workflows/build-push.yml
with:
Expand Down
49 changes: 24 additions & 25 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
# .github/workflows/bot-ci.yml
# .github/workflows/lint.yml

name: Bot CI Pipeline
name: Lint Workflow

on:
push:
paths:
- "bot/**"
pull_request:
paths:
- "bot/**"
workflow_call:
inputs:
app_path:
description: 'Path to the application directory'
required: true
type: string
linter_configs:
description: 'Additional linter configurations'
required: false
type: mapping

jobs:
lint:
uses: ./.github/workflows/lint.yml
with:
app_path: "./bot"
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

test:
uses: ./.github/workflows/test.yml
with:
app_path: "./bot"
node_version: "20"
cache_dependency_path: "./bot/package-lock.json"

build-push:
needs: [lint, test]
uses: ./.github/workflows/build-push.yml
with:
app_name: "bot"
context: "./bot"
dockerfile: "./bot/Dockerfile"
- name: Run Linter
uses: super-linter/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_WORKSPACE: ${{ github.workspace }}/${{ inputs.app_path }}
TYPESCRIPT_DEFAULT_STYLE: prettier
${{ toJson(inputs.linter_configs) }}
2 changes: 1 addition & 1 deletion bot/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ async function app(): Promise<void> {
}

app().catch((error) => {
logger.fatal(error, 'Failed To start the application!!!!');
logger.fatal(error, 'Failed To start the application!!');
});

0 comments on commit cfe6f79

Please sign in to comment.