DEV Community

Gabor Szabo
Gabor Szabo

Posted on • Originally published at code-maven.com

Day 15: Failing CI to help fixing filesystem issues in a Python package

A few days ago, while I was looking for a Python package to set up with CI, I bumped into the vfxpaths. I tried to run the tests on my Ubuntu-based Docker container, but they failed due to some path-issues I reported.

Yesterday the author updated the issue saying that it has been fixed so today I tried it again.

It failed again, but this time on a test-file that was added a few hours ago. I updated the issue, but now that I see the author is actually interested fixing this issue, I though it might be more useful if I configured GitHub Action on the 3 platforms.

Once this pull-request is accepted on every push the tests will run on Linux, Windows, and macOS so the author will get almost immediate feedback if the path issue was solved and later if that or anything else breaks again it will be much faster to notice and therefor much easier to fix.

GitHub Actions

name: CI

on:
  push:
  pull_request:
  workflow_dispatch:
#  schedule:
#    - cron: '42 5 * * *'

jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        runner: [ubuntu-latest, macos-latest, windows-latest]
        python-version: ["3.11"]

    runs-on: ${{matrix.runner}}
    name: OS ${{matrix.runner}} Python ${{matrix.python-version}}

    steps:
    - name: Checkout
      uses: actions/checkout@v3

    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v4
      with:
        python-version: ${{ matrix.python-version }}

    - name: Install dependencies
      run: |
        # pip install -r requirements.txt
        pip install pytest

    - name: Check Python version
      run: python -V

    - name: Test with pytest
      run: pytest -vs
Enter fullscreen mode Exit fullscreen mode

Conclusion

Sometimes there is clear evidence that having a CI running on every push can shorten the feedback cycle and allow people who might have no direct access to all 3 operating system (which is about everyone) to see if their code works there and to experiment fixing issue on other platforms as well.

Top comments (0)