Skip to content

Commit 4d7b5c4

Browse files
authored
Merge pull request #327 from StochSS/develop
Release v1.1.2
2 parents 414b8c9 + f35fd77 commit 4d7b5c4

35 files changed

+13592
-1845
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: PyLint On Pull Request
2+
on: [pull_request]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-20.04
6+
steps:
7+
- name: Set Up Python
8+
uses: actions/setup-python@v2
9+
- name: Install PyLint
10+
run: pip install --upgrade pylint
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- name: Checkout Head
16+
run: git checkout $HEAD_REF
17+
env:
18+
HEAD_REF: ${{ github.event.pull_request.head.ref }}
19+
- name: Checkout Base
20+
run: git checkout $BASE_REF
21+
env:
22+
BASE_REF: ${{ github.event.pull_request.base.ref }}
23+
- name: Get Base Lint Score
24+
run: |
25+
echo BASE_LINT=$(git diff --name-only --diff-filter=M $HEAD_REF | grep -E "\.py" | xargs pylint | grep -E -o "at [0-9.-]+" | grep -E -o [0-9.-]+) >> $GITHUB_ENV
26+
env:
27+
HEAD_REF: ${{ github.event.pull_request.head.ref }}
28+
if: always()
29+
- name: Set Base Lint to 0
30+
run: echo BASE_LINT=0 >> $GITHUB_ENV
31+
if: env.BASE_LINT == ''
32+
- name: Checkout Head
33+
run: git checkout $HEAD_REF
34+
env:
35+
HEAD_REF: ${{ github.event.pull_request.head.ref }}
36+
- name: Get Head Lint Score
37+
run: |
38+
echo HEAD_LINT=$(git diff --name-only --diff-filter=M $BASE_REF | grep -E "\.py" | xargs pylint | grep -E -o "at [0-9.-]+" | grep -E -o [0-9.-]+) >> $GITHUB_ENV
39+
env:
40+
BASE_REF: ${{ github.event.pull_request.base.ref }}
41+
if: always()
42+
- name: Set Head Lint to 0
43+
run: echo HEAD_LINT=0 >> $GITHUB_ENV
44+
if: env.HEAD_LINT == ''
45+
- name: Get Added Files Lint Score
46+
run: |
47+
echo ADDED_LINT=$(git diff --name-only --diff-filter=A $BASE_REF | grep -E "\.py" | xargs pylint | grep -E -o "at [0-9.-]+" | grep -E -o [0-9.-]+) >> $GITHUB_ENV
48+
env:
49+
BASE_REF: ${{ github.event.pull_request.base.ref }}
50+
if: always()
51+
- name: Get Delta
52+
run: |
53+
import os
54+
base = float(os.environ['BASE_LINT'])
55+
head = float(os.environ['HEAD_LINT'])
56+
delta = head - base
57+
os.popen(f"echo DELTA={round(delta, 2)} >> $GITHUB_ENV")
58+
shell: python
59+
- name: Display Results
60+
run: |
61+
echo "Lint of modified files in base:"
62+
echo ${{ env.BASE_LINT }}
63+
echo "Lint of modified files in head:"
64+
echo ${{ env.HEAD_LINT }}
65+
echo "Delta (+/-):"
66+
echo ${{ env.DELTA }}
67+
echo "Lint of files added by head:"
68+
echo ${{ env.ADDED_LINT }}
69+
if: always()
70+
- name: Fail If Negative Delta
71+
run: |
72+
import os
73+
if float(os.environ['HEAD_LINT']) < 9 and float(os.environ['DELTA']) < 0:
74+
raise Exception("Head lint score < 9 and negative delta.")
75+
shell: python

.github/workflows/update-docs.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Publish SpatialPy Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Initialize environment
13+
uses: actions/checkout@v2
14+
with:
15+
ref: main
16+
fetch-depth: 0
17+
18+
- name: Install Python
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: '3.7'
22+
23+
- name: Install Sphinx Dependency
24+
run: |
25+
python3 -m pip install --upgrade pip
26+
python3 -m pip install -U sphinx
27+
python3 -m pip install numpy
28+
python3 -m pip install -r requirements.txt
29+
30+
- name: Update the Docs
31+
working-directory: docs
32+
run: |
33+
make build-docs
34+
35+
- name: Commit Changes
36+
working-directory: docs
37+
run: |
38+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
39+
git config --local user.name "github-actions[bot]"
40+
make commit-docs
41+
42+
- name: Push Changes
43+
uses: ad-m/github-push-action@master
44+
with:
45+
github_token: ${{ secrets.GITHUB_TOKEN }}
46+
branch: main

docs/Makefile

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,25 +84,34 @@ autobuild: $(FORMAT)
8484
clean:
8585
rm -rf "$(BUILDDIR)"
8686

87-
publish:
87+
build-docs:
88+
git pull
8889
make clean
8990
git stash
90-
git checkout gh-pages
91+
git checkout main
9192
make html
93+
94+
commit-docs:
9295
-git add -f "$(BUILDDIR)"
93-
-git commit -m "Latest build." "$(BUILDDIR)"
94-
git push origin gh-pages -f
95-
make clean
96-
git checkout @{-1}
97-
git stash pop
96+
-git commit -m "Latest docs build." "$(BUILDDIR)"
9897

99-
publish-release: publish
98+
publish:
10099
make clean
101100
git stash
102-
git checkout main
101+
git pull
102+
git checkout staging
103103
make html
104104
-git add -f "$(BUILDDIR)"
105105
-git commit -m "Latest docs build." "$(BUILDDIR)"
106+
git push origin staging -f
107+
make clean
108+
git checkout gh-pages
109+
git pull origin staging
110+
git push origin gh-pages -f
111+
git checkout @{-2}
112+
git stash pop
113+
114+
publish-release: build-docs commit-docs
106115
git push origin main -f
107116
make clean
108117
git checkout @{-1}

docs/build/html/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 8b8c7260a070827b00291bef99cea017
3+
config: aa9a9a3c9380df45ffa4c7a40b7ba182
44
tags: 645f666f9bcd5a90fca523b33c5a78b7
-43.1 KB
Binary file not shown.
-103 Bytes
Binary file not shown.
-2.34 KB
Binary file not shown.
-416 Bytes
Binary file not shown.
250 KB
Binary file not shown.
-1.14 KB
Binary file not shown.

0 commit comments

Comments
 (0)