-
Notifications
You must be signed in to change notification settings - Fork 39
65 lines (60 loc) · 2.08 KB
/
auto-update-files.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
# This workflow will install Python dependencies and update the time and EOP files
name: Auto-Update Files
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0 1 * *'
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Set up conda ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: pyTMD
environment-file: environment.yml
- name: Create conda Test Environment
run: |
conda install flake8 pytest pytest-cov cython
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pip install --no-deps .
pytest test/test_leap_seconds.py test/test_eop.py \
--username=${{ secrets.EARTHDATA_USERNAME }} \
--password=${{ secrets.EARTHDATA_PASSWORD }}
- name: Check for changes
id: changes
run: |
if [ -n "$(git status --porcelain)" ] ; then
echo "DETECTED=true" >> $GITHUB_OUTPUT;
echo "::debug::Changes detected";
else
echo "DETECTED=false" >> $GITHUB_OUTPUT;
echo "::debug::No changes detected";
fi
- name: Create pull request
if: steps.changes.outputs.DETECTED == 'true'
uses: peter-evans/create-pull-request@v3
with:
assignees: ${{ github.actor }}
title: "data: automatic time updates"