Skip to content

docs: 撰寫主題說明文件雛型 #1

docs: 撰寫主題說明文件雛型

docs: 撰寫主題說明文件雛型 #1

# 用來檢查專案中的潛在問題的 GitHub Actions 工作流程(workflow)定義檔
#
# 編輯參考:
#
# * Workflow syntax for GitHub Actions - GitHub Docs
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#
# Copyright 2022 林博仁(Buo-ren, Lin) <[email protected]>
# SPDX-License-Identifier: CC-BY-SA-4.0
name: 檢查專案中的潛在問題
on:
push:
branches:
- '**'
jobs:
check-using-precommit:
name: 使用 pre-commit 檢查專案中的潛在問題
runs-on: ubuntu-22.04
env:
PIP_CACHE_DIR: ${{ github.workspace }}/.cache/pip
PRE_COMMIT_HOME: ${{ github.workspace }}/.cache/pre-commit
SHELLCHECK_DIR: ${{ github.workspace }}/.cache/shellcheck-stable
steps:
- name: 自版控庫取出內容
uses: actions/checkout@v4
- name: Configure PyPI data cache to speed up continuous integration
uses: actions/cache@v3
with:
key: ${{ runner.os }}-pip
path: ${{ env.PIP_CACHE_DIR }}
- name: >-
Configure pre-commit data cache to speed up continuous integration
uses: actions/cache@v3
with:
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }}
path: ${{ env.PRE_COMMIT_HOME }}
- name: >-
Configure pre-built ShellCheck cache to speed up continuous integration
uses: actions/cache@v3
with:
key: ${{ runner.os }}-${{ runner.arch }}-shellcheck
path: ${{ env.SHELLCHECK_DIR }}
- name: >-
Patch the sudo security policy so that programs run via sudo
will recognize environment variables predefined by GitHub
run: sudo ./continuous-integration/patch-github-actions-sudo-security-policy.sh
- name: Run the static analysis programs
run: |
sudo ./continuous-integration/do-static-analysis.install-system-deps.sh
./continuous-integration/do-static-analysis.sh
- name: Send CI result notification to the Telegram channel
uses: yanzay/[email protected]
if: always()
with:
chat: '@libre_knowledge_ci'
token: ${{ secrets.telegram_bot_api_token_ci }}
status: ${{ job.status }}