Skip to content

build(deps): Bump actions/create-github-app-token from 2 to 3 in the github-actions group #243

build(deps): Bump actions/create-github-app-token from 2 to 3 in the github-actions group

build(deps): Bump actions/create-github-app-token from 2 to 3 in the github-actions group #243

Workflow file for this run

name: Main
on:
push:
branches:
- main
pull_request:
jobs:
check-workflows:
name: Check workflows
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Download actionlint
id: download-actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/e7d448ef7507c20fc4c88a95d0c448b848cd6127/scripts/download-actionlint.bash) 1.7.8
shell: bash
- name: Check workflow files
run: ${{ steps.download-actionlint.outputs.executable }} -color
shell: bash
prepare:
name: Prepare
runs-on: ubuntu-latest
needs:
- check-workflows
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up environment
uses: ./.github/actions/setup-environment
with:
python-version: 3.14
cache-dependencies: 'true'
test:
name: Test
runs-on: ubuntu-latest
needs:
- prepare
permissions:
contents: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up environment
uses: ./.github/actions/setup-environment
with:
python-version: 3.14
- name: Test
run: poetry poe test
- name: Upload coverage
uses: codecov/codecov-action@v5
with:
use_oidc: true
report_type: coverage
- name: Upload test results
if: ${{ !cancelled() }}
uses: codecov/codecov-action@v5
with:
use_oidc: true
report_type: test_results
lint:
name: Lint
runs-on: ubuntu-latest
needs:
- prepare
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Set up environment
uses: ./.github/actions/setup-environment
with:
python-version: 3.14
- name: Lint
run: poetry run pre-commit run -a --show-diff-on-failure
check-integration:
name: Check integration
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Check HACS compatibility
uses: hacs/action@22.5.0
with:
category: integration
- name: Check Hassfest
uses: home-assistant/actions/hassfest@87c064c607f3c5cc673a24258d0c98d23033bfc3
all-jobs-complete:
name: All jobs complete
runs-on: ubuntu-latest
needs:
- test
- lint
- check-integration
outputs:
passed: ${{ steps.set-output.outputs.passed }}
steps:
- name: Set output
id: set-output
run: |
echo "passed=true" >> "$GITHUB_OUTPUT"
all-jobs-pass:
name: All jobs pass
runs-on: ubuntu-latest
if: ${{ always() }}
needs:
- all-jobs-complete
steps:
- name: Check if all jobs passed
env:
PASSED: ${{ needs.all-jobs-complete.outputs.passed }}
run: |
if [ "$PASSED" != "true" ]; then
exit 1
fi
echo "All jobs passed."
is-release:
name: Check if release
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && startsWith(github.event.head_commit.author.name, 'hass-free-sleep') }}
needs:
- all-jobs-pass
outputs:
is-release: ${{ steps.check-release.outputs.is-release }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 2
- name: Check if release
id: check-release
env:
BEFORE: ${{ github.event.before }}
run: |
git fetch origin "$BEFORE"
MANIFEST_FILE="./custom_components/free_sleep/manifest.json"
VERSION_BEFORE="$(git show "$BEFORE":"$MANIFEST_FILE" | jq --raw-output .version)"
VERSION_AFTER="$(jq --raw-output .version "$MANIFEST_FILE")"
if [ "$VERSION_BEFORE" != "$VERSION_AFTER" ]; then
echo "is-release=true" >> "$GITHUB_OUTPUT"
else
echo "is-release=false" >> "$GITHUB_OUTPUT"
fi
publish-release:
name: Publish release
if: ${{ needs.is-release.outputs.is-release == 'true' }}
needs:
- is-release
uses: ./.github/workflows/publish-release.yaml
permissions:
contents: write