Skip to content

Commit

Permalink
feat: init project typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
cubxxw committed Mar 21, 2024
1 parent 8313929 commit ef0ee91
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/code-language-detector.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
directory: ./
file_types:
- .go
- .yaml
- .yml
languages:
- Chinese
13 changes: 13 additions & 0 deletions .github/workflows/go-typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Go Typecheck Workflow Test

on: [push, pull_request]

jobs:
comment-language-detector:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Code Language Detector
uses: kubecub/typecheck@latest
13 changes: 13 additions & 0 deletions .github/workflows/language-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Language Check Workflow Test

on: [pull_request]

jobs:
comment-language-detector:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Code Language Detector
uses: kubecub/[email protected]
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Type Check

on: [push, pull_request]

jobs:
comment-language-detector:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '^1.21'

- name: Install typecheck
run: |
go install github.com/kubecub/typecheck@latest
- name: Run typecheck Detector
run: typecheck
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@

# Go workspace file
go.work

typecheck
bin/typecheck
41 changes: 41 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright © 2024 KubeCub open source community. All rights reserved.
# Licensed under the MIT License (the "License");
# you may not use this file except in compliance with the License.

name: 'Code Language Detector'
description: 'Detects specified languages in comments within code files.'
inputs:
go-version:
description: 'The version of Go to use for running the detector.'
required: true
default: '1.21'
detector-version:
description: 'The version of the Comment Language Detector to install.'
required: false
default: 'latest'
config-path:
description: 'Path to the configuration file for the detector.'
required: false

runs:
using: 'composite'
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ inputs.go-version }}

- name: Install Comment Language Detector
run: go install github.com/kubecub/typecheck@${{ inputs.detector-version }}
shell: bash

- name: Run Comment Language Detector
run: typecheck
shell: bash

branding:
icon: 'search'
color: 'blue'

0 comments on commit ef0ee91

Please sign in to comment.