Calmcode - github actions: schedule

GitHub Actions that Depend on Eachother

1 2 3 4 5 6

If you go to the scikit-lego repository on GitHub, you can find a workflow file that describes a scheduled job. Here's the contents.

name: Cron Test Dependencies

on:
  schedule:
    - cron: "0 0 * * *"

jobs:
  cron:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        python-version: [3.7]
        os: [macos-10.15, ubuntu-latest, windows-latest]
        pre-release-dependencies: ["--pre", ""]
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        python -m pip install wheel
        pip install ${{ matrix.pre-release-dependencies }} scikit-lego
        pip freeze
    - name: Test with pytest
      run: |
        pip install -e ".[test]"
        pytest

This workflow fixes an interesting problem for the maintainers of the project.

Before, the maintainers had to hear from users when a dependency introduced breaking changes. Now, this workflow runs unit tests using the latest versions of all dependencies. If the tests break, the maintainers can quickly pinpoint what package caused it and create a fix. You can imagine how this makes it much easier to maintain a package for the long run.