Main #902
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: Main | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 1 * * *' | |
push: | |
branches: | |
- develop | |
- main | |
paths-ignore: | |
- 'mkdocs.yml' | |
- '_docs/**' | |
pull_request: | |
branches-ignore: | |
- main | |
paths-ignore: | |
- 'mkdocs.yml' | |
- '_docs/**' | |
jobs: | |
validate: | |
if: ${{ github.event_name != 'schedule' || github.repository_owner == 'BottlecapDave' }} | |
name: Validate | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: "home-assistant/actions/hassfest@master" | |
- name: HACS Action | |
uses: "hacs/action@main" | |
with: | |
ignore: "brands" | |
category: "integration" | |
unit_tests: | |
if: ${{ github.event_name != 'schedule' || github.repository_owner == 'BottlecapDave' }} | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: asdf_install | |
uses: asdf-vm/actions/install@v3 | |
- name: Install Python modules | |
run: | | |
pip install -r requirements.test.txt | |
- name: Run unit tests | |
run: | | |
python -m pytest tests/unit | |
integration_tests: | |
# Tests are geared towards my account, so ignore for others | |
if: ${{ github.repository_owner == 'BottlecapDave' }} | |
name: Integration Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: asdf_install | |
uses: asdf-vm/actions/install@v3 | |
- name: Install Python modules | |
run: | | |
pip install -r requirements.test.txt | |
- name: Run integration tests | |
run: | | |
python -m pytest tests/integration | |
release: | |
name: Release | |
if: ${{ github.repository_owner == 'BottlecapDave' && github.ref == 'refs/heads/main' }} | |
needs: | |
- validate | |
- unit_tests | |
- integration_tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: asdf_install | |
uses: asdf-vm/actions/install@v3 | |
- name: Install dependencies | |
run: npm ci | |
- name: Release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: npm run release | |
- name: Merge main into develop | |
uses: devmasx/merge-branch@master | |
with: | |
type: now | |
message: "chore: Merged main into develop" | |
from_branch: main | |
target_branch: develop | |
github_token: ${{ secrets.GITHUB_TOKEN }} |