Skip to content

Pin CI actions to commit hashes (#2075) #1792

Pin CI actions to commit hashes (#2075)

Pin CI actions to commit hashes (#2075) #1792

Workflow file for this run

name: CI
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
workflow_dispatch: # to allow manual re-runs
jobs:
linting:
name: "Perform linting checks"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: "actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5" # v4.3.1
- uses: "actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065" # v5.6.0
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip "poetry==2.0.1"
poetry install --extras docs
- name: "Run pre-commit hooks"
run: |
poetry run pre-commit run --all-files --verbose
tests:
name: "Python ${{ matrix.python-version}} on ${{ matrix.os }}"
needs: linting
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11", "3.12", "3.13"]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: "actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5" # v4.3.1
- uses: "actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065" # v5.6.0
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip "poetry==2.0.1"
poetry install --all-extras
- name: "Run tests"
run: |
poetry run pytest --cov miio --cov-report xml
- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@0fb7174895f61a3b6b78fc075e0cd60383518dac" # v5.5.5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}