CI #619
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: CI | |
# yamllint disable-line rule:truthy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: "0 0 * * *" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: eifinger/setup-rye@v4 | |
id: setup-rye | |
with: | |
enable-cache: true | |
cache-prefix: ${{ matrix.python-version }} | |
- name: Pin python-version ${{ matrix.python-version }} | |
run: rye pin ${{ matrix.python-version }} | |
- name: Install dependencies | |
if: steps.setup-rye.outputs.cache-hit != 'true' | |
run: | | |
rye sync | |
- name: Cache pre-commit | |
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2 | |
with: | |
path: ~/.cache/pre-commit | |
key: pre-commit-|${{ matrix.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }} | |
- name: Lint | |
run: | | |
rye run pre-commit run --all-files | |
env: | |
SKIP: no-commit-to-branch | |
- name: Lint GitHub Actions | |
uses: eifinger/actionlint-action@v1 | |
hacs: | |
name: HACS Action | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: "actions/checkout@v4" | |
- name: HACS Action | |
uses: "hacs/action@main" | |
with: | |
category: "integration" | |
hass_validate: | |
name: Hassfest | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: "actions/checkout@v4" | |
- name: Hassfest | |
uses: home-assistant/actions/hassfest@master | |
noop-release: | |
name: Semantic Release Noop | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
if: github.ref != 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Python Semantic Release Noop | |
uses: python-semantic-release/python-semantic-release@v7.34.6 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
repository_username: __token__ | |
repository_password: ${{ secrets.PYPI_TOKEN }} | |
additional_options: "--noop" | |
release: | |
name: Semantic Release | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Python Semantic Release | |
uses: python-semantic-release/python-semantic-release@v7.34.6 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
repository_username: __token__ | |
repository_password: ${{ secrets.PYPI_TOKEN }} |