From b0a99cb4f7b1ed9b2d9d0145f227a53db092e1c7 Mon Sep 17 00:00:00 2001 From: dqy <1016751306@qq.com> Date: Wed, 24 Apr 2024 17:12:35 +0800 Subject: [PATCH] =?UTF-8?q?test:=20=E6=B5=8B=E8=AF=95action.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/detection.yml | 29 +++++++++++++++++++++++++++++ .github/workflows/python-test.yml | 18 ------------------ 2 files changed, 29 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/detection.yml delete mode 100644 .github/workflows/python-test.yml diff --git a/.github/workflows/detection.yml b/.github/workflows/detection.yml new file mode 100644 index 0000000..916656f --- /dev/null +++ b/.github/workflows/detection.yml @@ -0,0 +1,29 @@ +name: Vulnerability and Backdoor Detection Workflow + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple + - name: Run tests + run: python -m unittest discover -s tests + + security_check: + runs-on: ubuntu-latest + needs: build # 确保安全检查在构建后执行 + steps: + - uses: actions/checkout@v2 + - uses: ./ # 使用当前仓库的根目录下的 action.yml + with: + code_path: "./src" + vulnerabilities_file: "./data/vulnerabilities.txt" + requirements_file: "./data/requirements.txt" + output_format: "txt" diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml deleted file mode 100644 index 1042ee4..0000000 --- a/.github/workflows/python-test.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Python application test - -on: - push: - branches: [main] - pull_request: - branches: [main] - -jobs: - build: - runs-on: "ubuntu-latest" - - steps: - - uses: actions/checkout@v2 - - name: Install dependencies - run: pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple - - name: Run tests - run: python -m unittest discover -s tests