Skip to content

Commit

Permalink
TST: Move CI from Azure to Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
pllim committed Jan 12, 2022
1 parent 43cba33 commit 602f8cc
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 37 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Run unit tests

on:
pull_request:
push:
branches: [ main ]
tags:
workflow_dispatch:
schedule:
# Run every Monday at 05:53 UTC
- cron: 53 5 * * 1

jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
testenv: [{python: 3.7, toxenv: py37-test-oldestdeps-cov}, {python: 3.8, toxenv: py38-test-cov}, {python: 3.9, toxenv: py39-test-cov}]
include:
- os: ubuntu-latest
testenv: [{python: 3.9, toxenv: codestyle}]
- os: ubuntu-latest
testenv: [{python: 3.8, build_docs}]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.testenv.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.testenv.python }}
- name: Install dependencies on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install geos-devel
sudo apt-get install freetype-devel
sudo apt-get install libpng-devel
- name: Install tox
run: python -m pip install tox
- name: Install codecov
if: ${{ contains(matrix.testenv.toxenv,'-cov') }}
run: python -m pip install codecov
- name: Run tox
run: tox -v -e ${{ matrix.testenv.toxenv }}
- name: Upload coverage to codecov
if: ${{ contains(matrix.testenv.toxenv,'-cov') }}
uses: codecov/codecov-action@v2
with:
file: ./coverage.xml

linux32:
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux2014_i686
steps:
# TODO: Use newer checkout actions when https://github.com/actions/checkout/issues/334 fixed
- name: Checkout code
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Install dependencies for Python 3.7
run: /opt/python/cp37-cp37/bin/pip install tox
- name: Run tests for Python 3.7
run: /opt/python/cp37-cp37/bin/python -m tox -e py37-test-oldestdeps-cov
- name: Install dependencies for Python 3.8
run: /opt/python/cp38-cp38/bin/pip install tox
- name: Run tests for Python 3.8
run: /opt/python/cp38-cp38/bin/python -m tox -e py38-test-cov
34 changes: 0 additions & 34 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,6 @@ trigger:

jobs:

- template: run-tox-env.yml@OpenAstronomy
parameters:
default_python: '3.8'
coverage: codecov

libraries:
yum:
- geos-devel
- freetype-devel
- libpng-devel

envs:

- linux: codestyle

- macos: py37-test-oldestdeps-cov
- macos: py38-test-cov
- macos: py39-test-cov

- linux: py37-test-oldestdeps-cov
- linux: py38-test-cov
- linux: py39-test-cov

- linux32: py37-test-oldestdeps-cov
- linux32: py38-test-cov

- windows: py37-test-oldestdeps-cov
- windows: py38-test-cov
- windows: py39-test-cov

- macos: build_docs
- linux: build_docs
- macos: build_docs

- template: publish.yml@OpenAstronomy
parameters:
test_command: pytest -p no:warnings --pyargs reproject
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{36,37,38}-{pep8,test}{-oldestdeps,}
py{37,38,39,310}-{test}{-oldestdeps}{-cov}
build_docs
codestyle
isolated_build = True
Expand Down Expand Up @@ -54,6 +54,6 @@ commands =
[testenv:codestyle]
skip_install = true
changedir = .
description = check code style, e.g. with flake8
description = check code style with flake8
deps = flake8
commands = flake8 reproject --count --max-line-length=100
commands = flake8 reproject --count

0 comments on commit 602f8cc

Please sign in to comment.