Merge pull request #222 from HTenkanen/prepare-release #352
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: test | |
on: | |
push: | |
pull_request: | |
workflow_call: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
name: Linting code | |
runs-on: ubuntu-latest | |
container: ubuntu:22.04 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install black and flake8 | |
run: python -m pip install black flake8 | |
- name: Lint using black | |
run: python -m black --check pyrosm | |
- name: Lint using flake8 | |
run: python -m flake8 pyrosm | |
test: | |
name: Run tests (${{ matrix.os }}, ${{ matrix.env }}) | |
needs: lint | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -l {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
env: | |
- ci/39-conda.yaml | |
- ci/310-conda.yaml | |
- ci/311-conda.yaml | |
- ci/312-conda.yaml | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install Conda environment with Micromamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: ${{ matrix.env }} | |
auto-activate-base: false | |
activate-environment: test | |
channel-priority: strict | |
- name: Install pyrosm | |
shell: bash -l {0} | |
run: pip install -e . | |
- name: Check environment | |
shell: bash -l {0} | |
run: | | |
micromamba info | |
micromamba list | |
- name: Test pyrosm | |
shell: bash -l {0} | |
run: pytest -v -r s --color=yes --cov=pyrosm --cov-append --cov-report term-missing --cov-report xml tests/ | |
- name: Update codecov.io | |
uses: codecov/codecov-action@v3.1.1 | |
with: | |
fail_ci_if_error: true |