You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spiel/.github/workflows/quality-check.yml

70 lines
1.9 KiB
YAML

name: quality-check
on:
push:
branches:
- main
pull_request:
jobs:
test-code:
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11"]
defaults:
run:
shell: bash
runs-on: ${{ matrix.platform }}
env:
PLATFORM: ${{ matrix.platform }}
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- name: Check out repository
uses: actions/checkout@v3.1.0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.3.0
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1.3
with:
virtualenvs-create: true
- name: Load cached virtual environment
id: cached-poetry-dependencies
uses: actions/cache@v3.0.11
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install package
run: poetry install --no-interaction
- name: Make sure we can build the package
run: poetry build -vvv
- name: Run tests
run: poetry run pytest --cov --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v3.1.1
with:
env_vars: PLATFORM,PYTHON_VERSION
fail_ci_if_error: true
test-docker:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3.1.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.2.1
with:
install: true
- name: Build Image
uses: docker/build-push-action@v3.2.0
with:
file: ./docker/Dockerfile
pull: true
push: false