Merge branch 'update-0.3.3' into update/mypy #111
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the action will run. | |
on: [push, pull_request] | |
# Older settings: | |
# Triggers the workflow on push request events for the master branch, | |
# and pull request events for all branches. | |
#on: | |
# push: | |
# branches: [ master ] | |
# pull_request: | |
# branches: [ '**' ] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: ["3.10", "3.11"] | |
os: [ubuntu-latest, macos-latest] #, windows-latest] # Run macos tests if really required, since they charge 10 times more for macos | |
include: | |
- os: ubuntu-latest | |
path: ~/.cache/pip | |
- os: macos-latest | |
path: ~/Library/Caches/pip | |
#- os: windows-latest | |
# path: ~\AppData\Local\pip\Cache | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v2 | |
# Ref: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4.2.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# You can test your matrix by printing the current Python version | |
- name: Display Python version | |
run: python -c "import sys; print(sys.version)" | |
# Install Poetry and dependencies | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: Set up cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ matrix.path }} | |
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
poetry config virtualenvs.in-project true | |
poetry install | |
# Runs a single command using the runners shell | |
- name: Welcome message | |
run: echo Hello, world! Welcome PyElastica Build, lets start testing! | |
# Run style checks (black and flake8) | |
- name: Run style checks | |
run: | | |
make check-codestyle | |
# Test PyElastica using pytest | |
- name: Run tests | |
run: | | |
make test | |
- name: Typechecking | |
if: ${{ startsWith(runner.os, 'macOS') }} | |
run: | | |
make mypy | |
report-coverage: # Report coverage from python 3.10 and mac-os. May change later | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
os: [macos-latest] | |
include: | |
- os: macos-latest | |
path: ~/Library/Caches/pip | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4.2.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: Set up cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ matrix.path }} | |
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install dependencies | |
run: | | |
poetry config virtualenvs.in-project true | |
poetry install | |
- name: Run style checks | |
run: | | |
make check-codestyle | |
- name: Test PyElastica using pytest | |
if: startsWith(runner.os, 'macOS') | |
run: | | |
make test_coverage_xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |