Skip to content

Commit b790537

Browse files
authored
Create main.yml
Forgot to set the regular infra up.
1 parent b8b5410 commit b790537

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/main.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: GitHub Actions
2+
3+
# only run this workflow on new commits to main
4+
# or PRs into main
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
branches:
11+
- main
12+
schedule:
13+
# Run every Monday morning at 11:00a UTC, 6:00a CST
14+
- cron: '0 11 * * 1'
15+
16+
jobs:
17+
test:
18+
name: ${{ matrix.task }}
19+
runs-on: ubuntu-latest
20+
strategy:
21+
fail-fast: false
22+
matrix:
23+
include:
24+
- task: linting
25+
- task: unit-tests
26+
- task: todo-checks
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v1
30+
- name: Set up Python 3.7
31+
if: matrix.task != 'todo-checks'
32+
uses: s-weigand/setup-conda@v1
33+
with:
34+
python-version: 3.7
35+
- name: linting
36+
if: matrix.task == 'linting'
37+
shell: bash
38+
run: |
39+
pip install --upgrade black flake8 mypy pylint
40+
make lint
41+
- name: unit-tests
42+
if: matrix.task == 'unit-tests'
43+
shell: bash
44+
run: |
45+
pip install --upgrade cloudpickle pytest pytest-cov responses
46+
make unit-tests
47+
- name: todo-checks
48+
if: matrix.task == 'todo-checks'
49+
shell: bash
50+
run: |
51+
num_todos=$(git grep -i -E "TODO|FIXME" | wc -l)
52+
echo "found ${num_todos} TODOs in code"
53+
num_allowed=10
54+
if [[ $num_todos -gt $num_allowed ]]; then
55+
exit ${num_todos}
56+
else
57+
exit 0
58+
fi

0 commit comments

Comments
 (0)