fix problems with advent #2
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: "Tests" | |
on: [push, pull_request, workflow_dispatch] | |
env: | |
FORCE_COLOR: 1 | |
jobs: | |
pre-commit: | |
name: Run Quality Assurance | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/[email protected] | |
- name: Run pre-commit | |
uses: pre-commit/[email protected] | |
test: | |
name: "Test: python=${{ matrix.python-version }} on ${{ matrix.os }}" | |
runs-on: ${{ matrix.os }} | |
needs: [pre-commit] | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
python-version: ["3.7", "3.8", "3.9", "3.10", "pypy-3.7"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: requirements_dev.txt | |
- name: Install dependencies | |
run: | | |
python -m pip install -U pip wheel 'coveralls>=3' | |
python -m pip install -U -r requirements_dev.txt | |
python -m pip install -e . | |
- name: Run tests | |
run: | | |
pytest | |
- name: Upload Coverage | |
run: coveralls --service=github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
COVERALLS_FLAG_NAME: tests-${{ matrix.python-version }}-${{ matrix.os }} | |
COVERALLS_PARALLEL: true | |
coveralls: | |
name: Finish Coveralls | |
needs: [test] | |
runs-on: ubuntu-latest | |
container: python:3-slim | |
steps: | |
- name: Finished | |
run: | | |
pip3 install -U 'coveralls>=3' | |
coveralls --finish --service=github | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') | |
needs: [test] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/[email protected] | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install -U pip wheel | |
pip install -U . | |
- name: Build dist | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: Publish package | |
uses: pypa/[email protected] | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_password }} |