CI_pytest_weekly #56
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
# This workflow will install Python dependencies and run tests with a variety of Python | |
# versions, with a trigger based on specific schedule. For more information see: | |
# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule | |
# | |
# Adapted from: https://github.com/actions/starter-workflows/blob/master/ci/python-package.yml | |
# | |
# Copyright (c) 2020-2023 MeteoSwiss, created by F.P.A. Vogt; [email protected] | |
name: CI_pytest_weekly | |
on: | |
workflow_dispatch: # Allow to trigger the weekly tests manually | |
schedule: | |
- cron: '43 21 * * 1,4' # Run at 21:43 UTC every Monday and Thursday | |
jobs: | |
pytest: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
# Checkout the master branch if this is a scheduled test | |
# The idea for this Action is to spot issues with new dependency versions as soon as they | |
# are released (and not when we decide to update ampycloud). | |
- name: Checkout current repository (master branch) | |
if: ${{ github.event_name == 'schedule' }} | |
uses: actions/checkout@v4 | |
with: | |
repository: MeteoSwiss/ampycloud | |
ref: master | |
# Alternatively, checkout whichever branch was selected by the user upon the manual trigger. | |
- name: Checkout current repository (custom branch) | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
uses: actions/checkout@v4 | |
with: | |
repository: MeteoSwiss/ampycloud | |
# Setup python | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.x' | |
# Install all the dependencies we require | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
# Here, let's install our module to make sure all the dependencies specified in setup.py are | |
# also installed | |
- name: Install our module | |
run: pip install -e .[dev] | |
# Ready to run all the tests ! | |
- name: Run pytest | |
run: | | |
pytest -s |