Bump github/codeql-action from 2 to 3 (#79) #245
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: Continuous Integration | |
on : | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
lint: | |
strategy: | |
matrix: | |
os: [ubuntu-latest] | |
python: ['3.11'] | |
include: | |
- os: ubuntu-latest | |
CACHE_PIP: ~/.cache/pip | |
CACHE_PRE_COMMIT: ~/.cache/pre-commit | |
name: Lint | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Caching | |
uses: actions/[email protected] | |
with: | |
path: | | |
${{ matrix.CACHE_PIP }} | |
${{ matrix.CACHE_PRE_COMMIT }} | |
key: lint-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('**/.pre-commit-config.yaml') | |
}} | |
restore-keys: | | |
lint-${{ runner.os }}-${{ matrix.python }}- | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry config virtualenvs.create false | |
poetry install | |
- name: Lint | |
run: | | |
poetry run pre-commit run --all-files | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
python: ['3.11', '3.12'] | |
include: | |
- os: ubuntu-latest | |
CACHE_PIP: ~/.cache/pip | |
CACHE_POETRY: ~/.cache/poetry | |
- os: windows-latest | |
CACHE_PIP: ~\AppData\Local\pip\Cache | |
CACHE_POETRY: ~\AppData\Local\poetry\Cache | |
- os: macos-latest | |
CACHE_PIP: ~/Library/Caches/pip | |
CACHE_POETRY: ~/Library/Caches/poetry | |
name: Test | |
runs-on: ${{ matrix.os }} | |
needs: lint | |
env: | |
OS: ${{ matrix.os }} | |
PYTHON: ${{ matrix.python }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Caching | |
uses: actions/[email protected] | |
with: | |
path: | | |
${{ matrix.CACHE_PIP }} | |
${{ matrix.CACHE_POETRY }} | |
key: test-${{ runner.os }}-${{ matrix.python }}-${{ hashFiles('**/pyproject.toml') | |
}} | |
restore-keys: | | |
test-${{ runner.os }}-${{ matrix.python }}- | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install poetry | |
poetry install | |
- name: Collect Environment | |
run: | | |
echo "PYTHON=$(python -c 'import platform; print(platform.python_version())')" >> $GITHUB_ENV | |
echo "OS=$(python dev/os_version.py)" >> $GITHUB_ENV | |
- name: Test | |
run: | | |
poetry run pytest --verbose --numprocesses=auto --cov=. --cov-config=dev/.coveragerc --cov-report=xml | |
- name: Coverage | |
uses: codecov/[email protected] | |
with: | |
env_vars: OS, PYTHON |