ci: Use dashed keyword for compliance #32
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
name: CI | |
on: | |
push: | |
branches: | |
- master | |
- github_ci | |
tags: | |
- '*' | |
jobs: | |
build_and_test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["2.7", "3.7", "3.8", "3.9", "3.10"] | |
include: | |
- python-version: "3.5" | |
os: ubuntu-20.04 | |
- python-version: "3.6" | |
os: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- uses: actions/cache@v3 | |
with: | |
key: ${{ runner.os}}-pip-${{ matrix.python-version }} | |
path: ~/.cache/pip | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: MatteoH2O1999/setup-python@v1 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache-build: true | |
- run: | | |
lsb_release -a | |
uname -a | |
if: startsWith(matrix.os, 'ubuntu') | |
- run: python --version | |
- name: Install dependencies | |
run: | | |
pip install -U pytest pytest-cov codecov coveralls | |
pip install -U cpp-coveralls | |
pip install scrutinizer-ocular | |
pip install pandas 'xarray<0.17' | |
- name: Install package | |
run: | | |
pip install -e ".[all]" | |
- run: pip list | |
- name: Test | |
run: | | |
py.test -v --doctest-glob='*.md' --cov src | |
coveralls --build-root=. --include=src --dump=cpp-coveralls.json | |
- name: Convert coverage | |
run: python -m coverage xml | |
- name: Upload coverage report | |
uses: codecov/codecov-action@v3 | |
- name: Upload to Coveralls | |
if: startsWith(matrix.os, 'ubuntu') && matrix.python-version != '2.7' | |
run: | | |
python -m coveralls --service=github --merge=cpp-coveralls.json | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_PARALLEL: true | |
COVERALLS_FLAG_NAME: py${{ matrix.python-version }} | |
coverage: | |
needs: build_and_test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.9" | |
- name: Finish coverage collection | |
run: | | |
python -m pip install -U pip | |
python -m pip install -U coveralls | |
python -m coveralls --finish | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |