Keep workflows active
Github will disable workflows for inactive projects, and a project goes inactive after 60 days with no commits.
This will stop smoke tests from detecting breaking changes from upstream package updates.
One solution (which I don't like, but I'm just leaving here to show there are automated solutions): https://github.com/marketplace/actions/keepalive-workflow
Alternatively, you have to pay attention to the github notifications and re-activate workflows each time you get an alert that they're being de-activated. From @DinoBektesevic:
Every 60 days or so without a commit, you just have to go to the actions tab and press "Enable worfklow" again. The issue I have with the automatic disable isn't that it happens it's that the notifications are by default enabled just for the person that made the workflow - not all "admins" or "maintainers" of the repo. This is how sometimes these things go by unnoticed unfortunately because people don't subscribe or watch the action (which I don't think you can do). There's an email GA that can be used as a replacement I believe.
Long term maintainability is one of the selling points for using the Python Project Template. We should really try to find a way to keep the smoke test active in the long term.
https://docs.github.com/en/actions/using-workflows/disabling-and-enabling-a-workflow?tool=webui
I've looked around, and it seems like the correct path forward that would allow users to be pretty long term hands off would be use a github action that pushes an empty commit to the repo.
The github action mentioned in the first comment seems to be the most popular one that I've been able to find after searching around in the marketplace. Though to be fair, it's hard to find anything there.
I've run some tests in my personal repo, and it seems ok. It does require the user to set a particular repository setting, which is just one more thing that a user has to do to get up and running.
Aside from that though, inserting it into the smoke-test.yml file would be fairly straightforward.
name: Unit test smoke test
on:
# Runs this workflow automatically
schedule:
- cron: 45 6 * * *
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
steps:
- 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: |
sudo apt-get update
python -m pip install --upgrade pip
pip install .
pip install .[dev]
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: List dependencies
run: |
pip list
- name: Run unit tests with pytest
run: |
python -m pytest
- uses: gautamkrishnar/keepalive-workflow
with:
commit_message: Keeping project active with empty commit
committer_username: keep-alive-bot
committer_email: {user_email} # taken from the copier answers
GitHub sends an email before disabling smoke tests, and this email has a big green link to a page with "Continue running workflow" button. Of course it is still easy to miss the email, but I believe it is not as bad as we expected it to be