Skip to content

Commit a4b785c

Browse files
authored
Update CI (#18)
* Break off lint job to separate file * Add black job * Make pretty * Update build-and-test job Use mamba and don't duplicate builds on local PRs.
1 parent 190e43c commit a4b785c

5 files changed

Lines changed: 263 additions & 159 deletions

File tree

.github/workflows/black.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Black
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
format:
8+
# We want to run on external PRs, but not on our own internal PRs as they'll be run
9+
# by the push to the branch. Without this if check, checks are duplicated since
10+
# internal PRs match both the push and pull_request events.
11+
if:
12+
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
13+
github.repository
14+
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-python@v2
19+
- uses: psf/black@stable
20+
with:
21+
args: ". --check"

.github/workflows/build-test-ci.yml

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ on: [push, pull_request]
44

55
jobs:
66
build-and-test:
7+
# We want to run on external PRs, but not on our own internal PRs as they'll be run
8+
# by the push to the branch. Without this if check, checks are duplicated since
9+
# internal PRs match both the push and pull_request events.
10+
if:
11+
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
12+
github.repository
13+
714
runs-on: ${{ matrix.os }}
815

916
defaults:
@@ -26,18 +33,21 @@ jobs:
2633
channel-priority: true
2734

2835
- name: Show conda installation info
29-
run: conda info
30-
31-
- name: Install dependencies
3236
run: |
33-
conda install --file=requirements.txt -c conda-forge
37+
conda info
3438
conda list
3539
40+
- name: Install requirements
41+
run: |
42+
conda install mamba
43+
mamba install --file=requirements.txt
44+
mamba list
45+
3646
- name: Build and install package
37-
run: pip install .
47+
run: pip install -e .
3848

3949
- name: Install testing dependencies
40-
run: conda install --file=requirements-testing.txt -c conda-forge
50+
run: mamba install --file=requirements-testing.txt
4151

4252
- name: Test
4353
run: |
@@ -47,19 +57,3 @@ jobs:
4757
- name: Coveralls
4858
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.8'
4959
uses: AndreMiras/coveralls-python-action@v20201129
50-
51-
lint:
52-
runs-on: ubuntu-latest
53-
54-
steps:
55-
- uses: actions/checkout@v2
56-
57-
- name: Set up Python 3.8
58-
uses: actions/setup-python@v2
59-
with:
60-
python-version: 3.8
61-
62-
- name: Lint
63-
run: |
64-
pip install flake8
65-
make lint

.github/workflows/flake8.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Flake8
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
7+
lint:
8+
# We want to run on external PRs, but not on our own internal PRs as they'll be run
9+
# by the push to the branch. Without this if check, checks are duplicated since
10+
# internal PRs match both the push and pull_request events.
11+
if:
12+
github.event_name == 'push' || github.event.pull_request.head.repo.full_name !=
13+
github.repository
14+
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: Set up Python 3.8
19+
uses: actions/setup-python@v2
20+
with:
21+
python-version: 3.8
22+
23+
- name: Lint
24+
run: |
25+
pip install flake8
26+
make lint

docs/source/conf.py

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717

1818
# -- Project information -----------------------------------------------------
1919

20-
project = 'bmi-heat'
21-
copyright = '2019, Eric Hutton'
22-
author = 'Eric Hutton'
20+
project = "bmi-heat"
21+
copyright = "2019, Eric Hutton"
22+
author = "Eric Hutton"
2323

2424

2525
# -- General configuration ---------------------------------------------------
@@ -28,16 +28,16 @@
2828
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
2929
# ones.
3030
extensions = [
31-
'sphinx.ext.autodoc',
32-
'sphinx.ext.intersphinx',
33-
'sphinx.ext.todo',
34-
'sphinx.ext.viewcode',
35-
'sphinx.ext.githubpages',
36-
'sphinx.ext.napoleon',
31+
"sphinx.ext.autodoc",
32+
"sphinx.ext.intersphinx",
33+
"sphinx.ext.todo",
34+
"sphinx.ext.viewcode",
35+
"sphinx.ext.githubpages",
36+
"sphinx.ext.napoleon",
3737
]
3838

3939
# Add any paths that contain templates here, relative to this directory.
40-
templates_path = ['_templates']
40+
templates_path = ["_templates"]
4141

4242
# List of patterns, relative to source directory, that match files and
4343
# directories to ignore when looking for source files.
@@ -49,22 +49,22 @@
4949

5050
# The theme to use for HTML and HTML Help pages. See the documentation for
5151
# a list of builtin themes.
52-
html_theme = 'alabaster'
52+
html_theme = "alabaster"
5353

5454
# Theme options are theme-specific and customize the look and feel of a theme
5555
# further. For a list of options available for each theme, see the
5656
# documentation.
57-
#html_theme_options = {}
57+
# html_theme_options = {}
5858

5959
# Add any paths that contain custom themes here, relative to this directory.
60-
#html_theme_path = []
60+
# html_theme_path = []
6161

6262
# The name for this set of Sphinx documents. If None, it defaults to
6363
# "<project> v<release> documentation".
64-
#html_title = None
64+
# html_title = None
6565

6666
# A shorter title for the navigation bar. Default is the same as html_title.
67-
#html_short_title = None
67+
# html_short_title = None
6868

6969
# The name of an image file (relative to this directory) to place at the top
7070
# of the sidebar.
@@ -73,25 +73,25 @@
7373
# The name of an image file (within the static path) to use as favicon of the
7474
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
7575
# pixels large.
76-
#html_favicon = None
76+
# html_favicon = None
7777

7878
# Add any paths that contain custom static files (such as style sheets) here,
7979
# relative to this directory. They are copied after the builtin static files,
8080
# so a file named "default.css" will overwrite the builtin "default.css".
81-
html_static_path = ['_static']
81+
html_static_path = ["_static"]
8282

8383
# Add any extra paths that contain custom files (such as robots.txt or
8484
# .htaccess) here, relative to this directory. These files are copied
8585
# directly to the root of the documentation.
86-
#html_extra_path = []
86+
# html_extra_path = []
8787

8888
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
8989
# using the given strftime format.
90-
#html_last_updated_fmt = '%b %d, %Y'
90+
# html_last_updated_fmt = '%b %d, %Y'
9191

9292
# If true, SmartyPants will be used to convert quotes and dashes to
9393
# typographically correct entities.
94-
#html_use_smartypants = True
94+
# html_use_smartypants = True
9595

9696
# Custom sidebar templates, maps document names to template names.
9797
html_sidebars = {
@@ -106,63 +106,63 @@
106106
"links.html",
107107
"sourcelink.html",
108108
"searchbox.html",
109-
]
109+
],
110110
}
111111

112112
# Additional templates that should be rendered to pages, maps page names to
113113
# template names.
114-
#html_additional_pages = {}
114+
# html_additional_pages = {}
115115

116116
# If false, no module index is generated.
117-
#html_domain_indices = True
117+
# html_domain_indices = True
118118

119119
# If false, no index is generated.
120-
#html_use_index = True
120+
# html_use_index = True
121121

122122
# If true, the index is split into individual pages for each letter.
123-
#html_split_index = False
123+
# html_split_index = False
124124

125125
# If true, links to the reST sources are added to the pages.
126-
#html_show_sourcelink = True
126+
# html_show_sourcelink = True
127127

128128
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
129-
#html_show_sphinx = True
129+
# html_show_sphinx = True
130130

131131
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
132-
#html_show_copyright = True
132+
# html_show_copyright = True
133133

134134
# If true, an OpenSearch description file will be output, and all pages will
135135
# contain a <link> tag referring to it. The value of this option must be the
136136
# base URL from which the finished HTML is served.
137-
#html_use_opensearch = ''
137+
# html_use_opensearch = ''
138138

139139
# This is the file name suffix for HTML files (e.g. ".xhtml").
140-
#html_file_suffix = None
140+
# html_file_suffix = None
141141

142142
# Language to be used for generating the HTML full-text search index.
143143
# Sphinx supports the following languages:
144144
# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja'
145145
# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr'
146-
#html_search_language = 'en'
146+
# html_search_language = 'en'
147147

148148
# A dictionary with options for the search language support, empty by default.
149149
# Now only 'ja' uses this config value
150-
#html_search_options = {'type': 'default'}
150+
# html_search_options = {'type': 'default'}
151151

152152
# The name of a javascript file (relative to the configuration directory) that
153153
# implements a search results scorer. If empty, the default will be used.
154-
#html_search_scorer = 'scorer.js'
154+
# html_search_scorer = 'scorer.js'
155155

156156
# Output file base name for HTML help builder.
157-
htmlhelp_basename = 'bmidoc'
157+
htmlhelp_basename = "bmidoc"
158158

159159

160160
# -- Extension configuration -------------------------------------------------
161161

162162
# -- Options for intersphinx extension ---------------------------------------
163163

164164
# Example configuration for intersphinx: refer to the Python standard library.
165-
intersphinx_mapping = {'https://docs.python.org/': None}
165+
intersphinx_mapping = {"https://docs.python.org/": None}
166166

167167
# -- Options for todo extension ----------------------------------------------
168168

0 commit comments

Comments
 (0)