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