Skip to content

Commit

Permalink
Clean up workflows on GitHub actions (#124)
Browse files Browse the repository at this point in the history
* separate coverage/lint workflow

* move the coverage/lint out of the normal tests

* try a consolidated tests.yml

* skip 2.7 on windows

* reduce duplicate workflows/jobs by adding some guards

* better names for tests?

* better wheel names

* T to t

* update submodule to 3.6.3
  • Loading branch information
ajfriend authored May 28, 2020
1 parent 480bf97 commit caa171f
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 106 deletions.
41 changes: 0 additions & 41 deletions .github/workflows/ci-macos.yml

This file was deleted.

46 changes: 0 additions & 46 deletions .github/workflows/ci-windows.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,43 +1,34 @@
name: CI-linux
name: coverage-lint

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

jobs:
tests:
name: "Python ${{ matrix.python-version }}"
name: Coverage and Lint
runs-on: ubuntu-latest

strategy:
matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]

steps:
- uses: actions/[email protected]
with:
submodules: recursive

- uses: actions/setup-python@v2
with:
python-version: "${{ matrix.python-version }}"
python-version: 3.8

- name: Install dependencies
- name: Install from source
run: |
set -xe
python -VV
python -m site
pip install --upgrade pip setuptools wheel
- name: Install from source
run: pip install .[all]
pip install .[all]
- name: Lint
run: flake8 src/h3 setup.py tests

- name: Tests
- name: Coverage
run: pytest --cov=h3 --full-trace --cov-report=xml

- name: Upload coverage to Codecov
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: tests

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
tests:
name: Py${{ matrix.python-version }} ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
exclude:
- os: windows-latest
python-version: 2.7

steps:
- uses: actions/[email protected]
with:
submodules: recursive

- uses: actions/setup-python@v2
with:
python-version: "${{ matrix.python-version }}"

## Start Windows stuff
- uses: ilammy/[email protected]
if: startsWith(matrix.os, 'windows')

- name: Set Windows Compiler
if: startsWith(matrix.os, 'windows')
run: |
echo "::set-env name=CC::cl.exe"
echo "::set-env name=CXX::cl.exe"
## End Windows stuff

- name: Install from source
run: |
pip install --upgrade pip setuptools wheel
pip install .[all]
- name: Tests
run: pytest --cov=h3 --full-trace
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ env:

jobs:
make_wheels:
name: Wheels
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down
12 changes: 12 additions & 0 deletions dev_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,15 @@
- [pyenv for multiple versions (to help with tox)](https://weknowinc.com/blog/running-multiple-python-versions-mac-osx)
- [tox stuff](https://blog.frank-mich.com/recipe-testing-multiple-python-versions-with-pyenv-and-tox/)
- [more tox stuff](https://blog.ionelmc.ro/2015/04/14/tox-tricks-and-patterns/)


# Updating the H3 submodule

```sh
cd src/h3lib
git checkout master
git pull
cd ..
git add h3lib
git commit ...
```
2 changes: 1 addition & 1 deletion src/h3lib
Submodule h3lib updated 121 files

0 comments on commit caa171f

Please sign in to comment.