Skip to content

Commit

Permalink
ci: Update workflow config files
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaokang2022 committed Jan 8, 2025
1 parent 09f62db commit ce365e1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,34 @@ jobs:

steps:
- uses: actions/checkout@main

- name: Setup Python
uses: actions/setup-python@main
with:
python-version: 3.13

- name: Install the GUI environment (ubuntu only)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb
Xvfb :99 -screen 0 1280x1024x24 &
echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Generate coverage report
run: |
pip install pytest
pip install pytest-cov
pip install .[opt]
pytest --cov --cov-report=xml --junitxml=junit.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
verbose: true

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,11 @@ jobs:

steps:
- uses: actions/checkout@main

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip3 install --upgrade pip
pip3 install pylint
pip3 install pytest
pip3 install .[opt]

- name: Install the GUI environment (ubuntu only)
if: runner.os == 'Linux'
Expand All @@ -39,7 +34,15 @@ jobs:
Xvfb :99 -screen 0 1280x1024x24 &
echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Install dependencies
run: |
pip3 install --upgrade pip
pip3 install pylint
pip3 install pytest
pip3 install .[opt]
- name: Lint with pylint
run: pylint $(git ls-files "*.py")

- name: Test with pytest
run: pytest
3 changes: 3 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@ jobs:
uses: actions/setup-python@main
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand Down

0 comments on commit ce365e1

Please sign in to comment.