This repository has been archived by the owner on Oct 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 12
82 lines (70 loc) · 2.41 KB
/
main.yaml
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
71
72
73
74
75
76
77
78
79
80
81
82
name: Build
on:
push:
branches: [ master ]
jobs:
unittests-n-commits:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv-to-requirements
pipenv_to_requirements
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Test with unittest
run: |
python -m unittest discover -p 'test_*.py'
- name: Check in requirements.txt and requirements-dev.txt
run: |
git add requirements*.txt
if [[ ! -z $(git status -s requirements*.txt) ]]
then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m 'Automatically generated requirements.txt and requirements-dev.txt' requirements*.txt
git push
fi
- name: Check in test outputs
run: |
find tests -name output -exec git add --force {} \;
if [[ ! -z $(git status -s tests) ]]
then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m 'Automated adding outputs from tests' tests
git push
fi
- name: Check in updated notebooks
run: |
if [[ ! -z $(git status -s notebooks) ]]
then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m 'Automated adding updated notebooks' notebooks
git push
fi
- name: Remove old docs
run: rm -fr docs/*
- name: Create new docs
run: python -c "from biolinkml.generators.markdowngen import MarkdownGenerator;
MarkdownGenerator('meta.yaml').serialize(directory='docs', image_dir='images')"
- name: Commit changes and push
run: |
git add docs
if [[ ! -z $(git status -s docs) ]]
then
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m 'Automated update to docs with GitHub Actions' docs
git push
fi