Merge pull request #4 from Coder-Vippro/add-check-action-for-pull-request

Add security check to GitHub Actions workflow
This commit was merged in pull request #4.
This commit is contained in:
Vu Quoc Anh
2024-10-26 15:19:13 +07:00
committed by GitHub

View File

@@ -6,38 +6,9 @@ on:
- main - main
jobs: jobs:
# Run unit tests for the project
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5.3.0
with:
python-version: '3.12.3'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
pip install -r requirements.txt
- name: Run unit tests
run: |
python -m pytest tests/
#run security check
- name: pyupio/safety-action
uses: pyupio/safety-action@v1.0.1
with:
api-key: ${{ secrets.SAFETY_API_KEY }}
# Build and push package to GitHub Container Registry (GHCR) # Build and push package to GitHub Container Registry (GHCR)
build-and-push-to-ghcr: build-and-push-to-ghcr:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: test # This job depends on the test job
steps: steps:
- name: Check out the repository - name: Check out the repository
uses: actions/checkout@v4 uses: actions/checkout@v4