workflow update #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Workflow | |
on: | |
push: | |
branches: | |
- '**' # This will trigger the workflow on push to any branch | |
pull_request: | |
branches: | |
- '**' # This will trigger the workflow on pull requests to any branch | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
# Step 2: Set up Python (Assuming tests are run using Python. Modify as per your tech stack) | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' # Specify the Python version you need | |
# Step 3: Install dependencies (Modify as per your project's dependency management tool) | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements_dev.txt ]; then pip install -r requirements.txt; fi | |
# Step 4: Run tests (Modify this step according to how you run tests in your project) | |
- name: Run tests | |
run: | | |
pytest --cov=./ # Example command to run tests with coverage | |
# Step 5: Upload coverage reports to Codecov | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} # Your Codecov token | |
file: ./coverage.xml # Adjust the path to your coverage report file if different | |
flags: unittests # Optional flags | |
name: codecov-umbrella # Optional name | |