Improve blueprint: Controller - Philips 929002398602 Hue Dimmer switch v2 #959
Workflow file for this run
This file contains hidden or 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 - PR | |
'on': | |
pull_request: | |
branches: | |
- main | |
jobs: | |
lint: | |
name: Run Linters | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9.15.0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- id: yamllint | |
name: Yamllint | |
uses: reviewdog/action-yamllint@v1 | |
with: | |
github_token: ${{ secrets.github_token }} | |
reporter: github-pr-check | |
yamllint_flags: '.' | |
fail_level: error | |
filter_mode: nofilter | |
continue-on-error: true | |
- id: eslint | |
name: ESLint | |
uses: reviewdog/[email protected] | |
with: | |
github_token: ${{ secrets.github_token }} | |
reporter: github-pr-check | |
eslint_flags: --ext js,jsx . | |
fail_level: error | |
filter_mode: nofilter | |
workdir: website | |
continue-on-error: true | |
- if: ${{ steps.yamllint.outcome == 'failure' }} | |
run: mkdir -p lint && echo "yamllint" >> lint/results.txt | |
- if: ${{ steps.eslint.outcome == 'failure' }} | |
run: mkdir -p lint && echo "eslint" >> lint/results.txt | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: lint | |
path: lint/results.txt | |
retention-days: 5 | |
if-no-files-found: ignore | |
- name: Report linters error | |
if: ${{ steps.yamllint.outcome == 'failure' || steps.eslint.outcome == 'failure' }} | |
run: exit 1 | |
format-lint: | |
name: Run formatters to check code formatting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9.15.0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- id: prettier | |
name: Prettier Check | |
uses: creyD/[email protected] | |
with: | |
dry: true | |
prettier_options: --write . | |
prettier_version: 3.5.0 | |
env: | |
GITHUB_TOKEN: ${{ secrets.github_token }} | |
- if: ${{ always() && steps.prettier.outcome == 'failure' }} | |
run: mkdir -p format-lint && echo "prettier" >> format-lint/results.txt | |
- if: ${{ always() && steps.prettier.outcome == 'failure' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: format-lint | |
path: format-lint/results.txt | |
if-no-files-found: ignore | |
build: | |
name: Check website build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 9.15.0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '22' | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Website - Build | |
run: cd website && pnpm build | |
changes: | |
name: Analyze changes | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out Git repository | |
uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
list-files: json | |
filters: | | |
blueprints: | |
- 'blueprints/**/*.yaml' | |
- if: ${{ steps.changes.outputs.blueprints == 'true' }} | |
id: blueprints_urls | |
env: | |
FILES: ${{ steps.changes.outputs.blueprints_files }} | |
REPO: ${{ github.event.pull_request.head.repo.full_name }} | |
run: | | |
mapfile -t files < <( jq '.[]' < <(echo ${FILES}) ) | |
for f in ${files[@]}; do echo "https://github.com/${REPO}/blob/${GITHUB_HEAD_REF}/$(echo $f | tr -d '"')" >> blueprints.txt; done | |
- env: | |
PR_NUM: ${{ github.event.number }} | |
run: echo $PR_NUM > pr_num.txt | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: changes_blueprints | |
path: blueprints.txt | |
retention-days: 5 | |
if-no-files-found: ignore | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: changes_pr_num | |
path: pr_num.txt | |
retention-days: 5 |