-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (59 loc) · 2.3 KB
/
CI_pytest_weekly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# 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:
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]
#python-version: # Use the latest Python version available for this test.
steps:
# Checkout the master branch from the repository
# 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
uses: actions/checkout@v3
with:
repository: MeteoSwiss/ampycloud
ref: master
# Setup python
- name: Set up Python
uses: actions/setup-python@v4
#with:
# python-version: ${{ matrix.python-version }}
# Check the python/conda setup (can be useful to diagnose bug with this Action)
# Powershell syntax adapted from:
# https://stackoverflow.com/questions/63805/equivalent-of-nix-which-command-in-powershell
# Answer from: petrsnd
- name: Check the setup (I)
if: matrix.os == 'windows-latest'
run: |
Get-Command python | Select-Object -ExpandProperty Definition
echo $CONDA
- name: Check the setup (II)
if: matrix.os != 'windows-latest'
run: |
which python
which conda
# 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]
# Read to run all the tests !
- name: Run pytest
run: |
pytest -s